-
Notifications
You must be signed in to change notification settings - Fork 4
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
WIP: Allow nullable integer columns to be used from Pandas 1.0+ #138
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
fb11eb5
Allow nullable integer columns to be used from Pandas 1.0+
vinceatbluelabs 9b038f8
Break out a function
vinceatbluelabs 864c6fa
Extract out common function
vinceatbluelabs cc27635
Swap out to generator expression using common function
vinceatbluelabs a908bb5
Rename function to reflect defaults
vinceatbluelabs f46f6b7
Fix test
vinceatbluelabs 4522d58
Increase coverage
vinceatbluelabs f2cee93
Ratchet coverage
vinceatbluelabs 37dd2c8
Add return type
vinceatbluelabs 08a52be
Unratchet mypy coverage
vinceatbluelabs a4fccb8
Drop eager import
vinceatbluelabs a6e5c58
Drop eager import
vinceatbluelabs dc4016e
Fix import name
vinceatbluelabs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
93.6700 | ||
93.7000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
92.5400 | ||
92.4900 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
import logging | ||
import json | ||
from typing import List, Dict, Mapping, IO, Any, TYPE_CHECKING | ||
from ..field import RecordsSchemaField | ||
from ...records_format import BaseRecordsFormat | ||
from ...processing_instructions import ProcessingInstructions | ||
from .known_representation import RecordsSchemaKnownRepresentation | ||
from ..errors import UnsupportedSchemaError | ||
from records_mover.records.schema.field import RecordsSchemaField | ||
from records_mover.records.records_format import BaseRecordsFormat | ||
from records_mover.records.processing_instructions import ProcessingInstructions | ||
from records_mover.records.schema.schema.known_representation import ( | ||
RecordsSchemaKnownRepresentation | ||
) | ||
from records_mover.records.schema.errors import UnsupportedSchemaError | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unrelated change. Generally I'd like to start moving away from relative import addressing, as it gets confusing and painful to rebaseline when I move code around. |
||
if TYPE_CHECKING: | ||
from pandas import DataFrame | ||
|
||
|
@@ -138,6 +140,7 @@ def from_fileobjs(fileobjs: List[IO[bytes]], | |
""" | ||
from records_mover.records.delimited import stream_csv | ||
from records_mover.pandas import purge_unnamed_unused_columns | ||
from records_mover.pandas import convert_dtypes | ||
|
||
if len(fileobjs) != 1: | ||
# https://github.com/bluelabsio/records-mover/issues/84 | ||
|
@@ -160,6 +163,7 @@ def from_fileobjs(fileobjs: List[IO[bytes]], | |
fileobj.seek(0) | ||
|
||
df = purge_unnamed_unused_columns(df) | ||
df = convert_dtypes(df) | ||
schema = RecordsSchema.from_dataframe(df, processing_instructions, | ||
include_index=False) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new Integer64 type in Pandas is not actually a type that has a base type, so there's no 'base' attribute in it.