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

added stricter joining of annotated fields #672

Merged
merged 3 commits into from
Feb 9, 2024

Conversation

nick-fournier-rsg
Copy link
Contributor

Added a check to prevent out of order pandas series from being concatenated improperly. If there is an index in the panda series then it is reindexed to match the final data frame, otherwise skip.

@dhensle
Copy link
Contributor

dhensle commented Feb 6, 2024

Context here is that the preprocessor runs all the python expressions and then concatenates them. If they are all pandas with the same index, they'll get joined together no problem. However, if for example it's an array that gets turned back into a pandas series but now has a different order, it'll be scrambled when you try to join them.

In other words, this PR helps prevent users from an incorrect merge when writing complicated preprocessor expressions.

@dhensle dhensle marked this pull request as ready for review February 6, 2024 22:16
@jpn--
Copy link
Member

jpn-- commented Feb 7, 2024

This PR seems like a great candidate for "show me in a unit test". Can we do that in a timely manner here?

@dhensle
Copy link
Contributor

dhensle commented Feb 8, 2024

Unit test added and passing. Ready for your review @jpn--.

@dhensle dhensle requested a review from jpn-- February 8, 2024 19:42
@jpn-- jpn-- merged commit bdc9cac into ActivitySim:develop Feb 9, 2024
18 checks passed
@jpn-- jpn-- mentioned this pull request Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants