Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix large csv reading #585 #605

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

majidaldo
Copy link

use file path and chain df iterators

use file path and chain df iterators
@postelrich
Copy link
Contributor

What specifically is this fixing?

@majidaldo
Copy link
Author

#585

@@ -368,7 +369,7 @@ def CSV_to_chunks_of_dataframes(c, chunksize=2 ** 20, **kwargs):
else:
rest = []

data = [first] + rest
data = chain([first], rest)
Copy link

@brandonwillard brandonwillard Feb 15, 2018

Choose a reason for hiding this comment

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

toolz.concat should be able to do this, no? It's already imported, too.

Copy link
Author

Choose a reason for hiding this comment

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

there is no toolz.chain. similar functions in toolz just import itertools.
toolz source:

def concat(seqs):
    """ Concatenate zero or more iterables, any of which may be infinite.

    An infinite sequence will prevent the rest of the arguments from
    being included.

    We use chain.from_iterable rather than ``chain(*seqs)`` so that seqs
    can be a generator.

    >>> list(concat([[], [1], [2, 3]]))
    [1, 2, 3]

    See also:
        itertools.chain.from_iterable  equivalent
    """
    return itertools.chain.from_iterable(seqs)



def concatv(*seqs):
    """ Variadic version of concat

    >>> list(concatv([], ["a"], ["b", "c"]))
    ['a', 'b', 'c']

    See also:
        itertools.chain
    """
    return concat(seqs)

Copy link

@brandonwillard brandonwillard Feb 15, 2018

Choose a reason for hiding this comment

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

Sorry, typo; I meant toolz.concat, and it looks like that was already imported.

Copy link
Author

Choose a reason for hiding this comment

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

do you want to change it?

@TBusen
Copy link

TBusen commented Jul 12, 2018

is this still being worked?

@majidaldo
Copy link
Author

no. it works.

@guillochon
Copy link

Any way to merge this soon? Currently preventing me from using odo.

@TBusen
Copy link

TBusen commented Jul 25, 2018

Same here, I can’t use odo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants