Skip to content

Better error when disposed resources are accessed #243

@mcon

Description

@mcon

In C# it's pretty easy to accidentally dispose of a resource whilst it's still being used by a task - if you end up reading a file using ParquetSharp after the ParquetFileReader has been disposed then in stead of getting a (more useful) ObjectDisposedException, the library in stead returns incorrect data.

An explicit version of what I ended up doing (yes, looks very silly when made explicit) was:

var file = new ParquetFileReader("myParquetFile");

// Assuming a row group exists
var groupReader = file.RowGroup(0);

file.Dispose()

// Assuming the group has at least one column
groupReader.Column(0); // Throws exception claiming no columns exist

This issue covers having the reader APIs throw ObjectDisposedException to make it clearer to the user how they've misused the library. There's a non-zero chance I might have time to produce a PR for this one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions