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

Reverse transform constraints later in the DataProcessor #1511

Merged
merged 5 commits into from
Jul 24, 2023

Conversation

fealho
Copy link
Member

@fealho fealho commented Jul 21, 2023

Resolve #1476.

@codecov-commenter
Copy link

codecov-commenter commented Jul 21, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (aae5305) 96.28% compared to head (4710b7b) 96.28%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1511   +/-   ##
=======================================
  Coverage   96.28%   96.28%           
=======================================
  Files          49       49           
  Lines        3932     3934    +2     
=======================================
+ Hits         3786     3788    +2     
  Misses        146      146           
Impacted Files Coverage Δ
sdv/data_processing/data_processor.py 96.16% <100.00%> (+0.02%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@fealho fealho marked this pull request as ready for review July 21, 2023 16:14
@fealho fealho requested a review from a team as a code owner July 21, 2023 16:14
@fealho fealho requested review from amontanez24 and frances-h and removed request for a team July 21, 2023 16:14
@fealho fealho force-pushed the issue-1476-change-constraint-order-during-reverse branch from f1677bb to 4710b7b Compare July 21, 2023 17:33
Comment on lines +720 to +721
for constraint in reversed(self._constraints_to_reverse):
reversed_data = constraint.reverse_transform(reversed_data)
Copy link
Contributor

Choose a reason for hiding this comment

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

would it work if you just did sampled_columns = constraint.reverse_transform(sampled_columns)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, I don't get what you mean, you can't apply reverse_transform to sampled_columns, since that's a list.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah you're right, I got confused. Should we just set sampled_columns to be reversed_data.columns on line 725 instead of extending. Otherwise that list might contain columns that were created by constraints that we don't want

Copy link
Member Author

Choose a reason for hiding this comment

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

That was actually the first thing I tried. It doesn't work because sampled_columns has the keys, which reversed_data.columns doesn't have.

Your concern is actually not a problem because of line 731, it removes any columns not seen in the metadata.I originally had an extra two lines to remove these extra columns directly, for clarity, but I decided to remove them since they were unnecessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense. Can you edit the comments before line 731 to add that extra columns will also be dropped?

Copy link
Contributor

@amontanez24 amontanez24 left a comment

Choose a reason for hiding this comment

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

Just a comment about updating a comment. LGTM!

Comment on lines +720 to +721
for constraint in reversed(self._constraints_to_reverse):
reversed_data = constraint.reverse_transform(reversed_data)
Copy link
Contributor

Choose a reason for hiding this comment

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

That makes sense. Can you edit the comments before line 731 to add that extra columns will also be dropped?

@fealho fealho merged commit c4a5230 into master Jul 24, 2023
28 checks passed
@fealho fealho deleted the issue-1476-change-constraint-order-during-reverse branch July 24, 2023 19:14
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.

Cannot use custom constraint transforms for certain columns (inconsistent ordering in forward vs. reverse)
4 participants