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

Attribute Error Fix in assign.py #14

Merged
merged 4 commits into from
Nov 29, 2024
Merged

Attribute Error Fix in assign.py #14

merged 4 commits into from
Nov 29, 2024

Conversation

kylacochrane
Copy link
Collaborator

@kylacochrane kylacochrane commented Nov 7, 2024

This PR resolves ISSUE12, which caused AttributeErrors during cluster address assignment when using 2 or fewer levels in GAS version 0.1.2.

The issue occurred because data[sample_id] values could be non-strings (e.g., floats/integers), causing an AttributeError when attempting to call .split() on these numeric types.

To fix this, cluster addresses are now converted to strings before splitting by the specified delimiterto ensure compatibility regardless of the data type inferred by pandas in the format_df function of the assign.py class.

Cluster address assignment with 2 or fewer levels can now be run through gas call and has been tested locally.

Copy link
Member

@apetkau apetkau left a comment

Choose a reason for hiding this comment

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

This looks great Kyla. Thanks so much for identifying and fixing this issue 😄. Just one small comment on the changelog, but I am approving the PR.

CHANGELOG.md Show resolved Hide resolved
@kylacochrane kylacochrane changed the base branch from main to dev November 20, 2024 17:30
@sgsutcliffe sgsutcliffe merged commit 404a47f into dev Nov 29, 2024
@sgsutcliffe sgsutcliffe deleted the fix-split-error branch November 29, 2024 16:19
@sgsutcliffe sgsutcliffe mentioned this pull request Dec 20, 2024
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.

AttributeError in assign class with format_df function.
3 participants