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

Fix representation of categorical data types in NewRowSynthesis metric #458

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

MaanasArora
Copy link

Resolves #397.

Reviewing the history of the file, it seems that the condition of checking for the O (object) data type was created to hard-code single quotes around the value instead of using repr:

if real_data[field].dtype == 'O':
field_filter = f'`{field}` == {repr(row[field])}'
else:
field_filter = f'`{field}` == {row[field]}'

But now that we have it, I propose we can remove the else condition as repr would handle our edge cases (such as formatting strings with quotes and integers with none).

Let me know if this works. Thank you very much!

@MaanasArora MaanasArora requested a review from a team as a code owner September 28, 2023 04:36
@MaanasArora MaanasArora requested review from R-Palazzo and removed request for a team September 28, 2023 04:36
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.

NewRowSynthesis fails with category data type
1 participant