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

Add the option to filter data entries according to multiple input values #59

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

rachelt44
Copy link
Contributor

No description provided.

@rachelt44 rachelt44 requested a review from drbwa January 26, 2025 13:05
@drbwa drbwa self-assigned this Jan 26, 2025
Comment on lines 177 to +181
if job_entry_filter:
for key, value in job_entry_filter.items():
df = df[df[key] != value]
df = df.drop(key, axis=1)
for entry in job_entry_filter:
df = df[~df[entry[constants.JOB_ENTRY_FILTER_NAME_COL]].isin(entry[constants.JOB_ENTRY_FILTER_VALUES_COL])]
if not entry[constants.JOB_ENTRY_FILTER_KEEP_COL]:
df = df.drop(entry[constants.JOB_ENTRY_FILTER_NAME_COL], axis=1)
Copy link

Choose a reason for hiding this comment

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

If I understand correctly, you can move the drop before the filtering and only
do the filtering when keep is True.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

keep means whether we keep in the data the column according to which we do filtering. If it is False, we still do filtering according to its values, but after filtering we discard the column as it is not needed anymore (e.g., is_valid column to indicate invalid configurations).

Copy link

Choose a reason for hiding this comment

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

Understand now 👍

@rachelt44 rachelt44 merged commit 7c67b2d into main Jan 27, 2025
1 check passed
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.

2 participants