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

[GSProcessing] Fix isinstance check for numerical features #955

Merged
merged 3 commits into from
Aug 10, 2024

Conversation

thvasilo
Copy link
Contributor

@thvasilo thvasilo commented Aug 6, 2024

Issue #, if available:

Description of changes:

  • Fixes corner case where a feature value might not be one of int/float (we don't cast Parquet input types), replacing with the more general numbers.Number.

Example of how to trigger a failure, as observed by a customer:

>>> import numbers
>>> import decimal
>>> dn = decimal.Decimal(5)
>>> intnum = 5
>>> isinstance(intnum, (float, int))
True
>>> isinstance(dn, (float, int))
False
>>> isinstance(dn, numbers.Number)
True

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@thvasilo thvasilo added bug Something isn't working ready able to trigger the CI gsprocessing For issues and PRs related the the GSProcessing library 0.3.1 labels Aug 6, 2024
@thvasilo thvasilo added this to the 0.3.1 milestone Aug 6, 2024
@thvasilo thvasilo requested a review from jalencato August 6, 2024 22:44
@thvasilo thvasilo self-assigned this Aug 6, 2024
Copy link
Collaborator

@jalencato jalencato left a comment

Choose a reason for hiding this comment

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

LGTM, but a small comment.

@thvasilo thvasilo requested a review from jalencato August 8, 2024 15:56
@thvasilo
Copy link
Contributor Author

thvasilo commented Aug 8, 2024

Made a small change to avoid code repetition and to implement @classicsong suggestion

@jalencato can you take a second look? The last commit pulls out the write_feature function and shares the implementation between nodes and edges.

@thvasilo thvasilo force-pushed the gsp-fix-feature-count branch from ddea8a7 to ae8bf55 Compare August 9, 2024 10:24
@thvasilo thvasilo merged commit fbad0c7 into awslabs:main Aug 10, 2024
3 checks passed
@thvasilo thvasilo deleted the gsp-fix-feature-count branch August 10, 2024 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.3.1 bug Something isn't working gsprocessing For issues and PRs related the the GSProcessing library ready able to trigger the CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants