Skip to content
This repository was archived by the owner on Aug 2, 2023. It is now read-only.

Load DataFrame from IDataReader - #2924

Closed
jmbeamer wants to merge 3 commits into
dotnet:masterfrom
jmbeamer:master
Closed

jmbeamer wants to merge 3 commits into
dotnet:masterfrom
jmbeamer:master

Conversation

@jmbeamer

Copy link
Copy Markdown

Not quite as straightforward as a LoadSql() method but I think this route offers a great amount of flexibility for importing data from many sources without introducing a dependency nightmare.

jmbeamer added 3 commits May 28, 2020 17:36
Utilizes IDataReader.GetSchemaTable() to deduce column names and types, then reads rows into the DataFrame
@dnfclas

dnfclas commented May 28, 2020 •

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@pgovind

pgovind commented May 28, 2020

Copy link
Copy Markdown

@jmbeamer: Thank you for opening this PR. Do you think you could add some unit tests too?

@jmbeamer

Copy link
Copy Markdown
Author

@pgovind: Sure — I'll add some this weekend

/// <param name="numberOfRowsToRead">number of rows to read not including the header(if present)</param>
/// <param name="addIndexColumn">add one column with the row index</param>
/// <returns><see cref="DataFrame"/></returns>
public static DataFrame FromDataReader(IDataReader reader, string[] columnNames = null, Type[] dataTypes = null, long numberOfRowsToRead = -1, bool addIndexColumn = false)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the PR was opened initially, this is how LoadCsv may have looked. When this PR becomes active again, we should finalize the shape/parameters in this API.

@pgovind pgovind added the OpenBeforeArchiving These issues were open before the repo was archived. For re-open them, file them in the new repo label Mar 11, 2021
@pgovind pgovind closed this Mar 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Microsoft.Data OpenBeforeArchiving These issues were open before the repo was archived. For re-open them, file them in the new repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants