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

HistogramOptions now named to HistogramAndQuantilesOptions, implement num_quantiles option to HistogramAndQuantilesOptions #956

Merged
merged 24 commits into from
Jul 20, 2023

Conversation

clee1152
Copy link
Contributor

@clee1152 clee1152 commented Jul 10, 2023

PR changes:

  • Changed HistogramOption to HistogramAndQuantilesOption
  • HistogramAndQuantilesOption now contains new attribute num_quantiles
  • HistogramOption now deprecated, loadsHistogramAndQuantilesOption in json_decoder
  • Tests updated accordingly for FloatColumnProfile, TextColumnProfile, IntColumnProfile, NumericStatsMixinProfile, and HistogramAndQuantilesOption

Copy link
Contributor

@JGSweets JGSweets left a comment

Choose a reason for hiding this comment

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

Need to fix what this is based off of.

@taylorfturner
Copy link
Contributor

Need to fix what this is based off of.

??

@taylorfturner taylorfturner changed the base branch from feature/quantile_options to feature/num-quantiles July 13, 2023 18:46
auto-merge was automatically disabled July 13, 2023 18:48

Head branch was pushed to by a user without write access

@taylorfturner taylorfturner enabled auto-merge (squash) July 13, 2023 18:50
@clee1152
Copy link
Contributor Author

Going to create a new PR for adding deprecated HistogramOptions.

auto-merge was automatically disabled July 19, 2023 17:12

Head branch was pushed to by a user without write access

@taylorfturner taylorfturner enabled auto-merge (squash) July 19, 2023 17:21
auto-merge was automatically disabled July 20, 2023 14:28

Head branch was pushed to by a user without write access

@taylorfturner taylorfturner enabled auto-merge (squash) July 20, 2023 15:02
auto-merge was automatically disabled July 20, 2023 17:38

Head branch was pushed to by a user without write access

@taylorfturner taylorfturner enabled auto-merge (squash) July 20, 2023 17:40
auto-merge was automatically disabled July 20, 2023 17:40

Head branch was pushed to by a user without write access

Comment on lines 116 to 119
self.quantiles: list[float] | None = None
self.quantiles: list[float] | dict = {
bin_num: None for bin_num in range(self._num_quantiles - 1)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

☠️

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm shook-eth

@taylorfturner taylorfturner enabled auto-merge (squash) July 20, 2023 18:33
auto-merge was automatically disabled July 20, 2023 19:25

Head branch was pushed to by a user without write access

@@ -71,13 +81,58 @@ def _assert_set_helper(prop, value):
with self.assertRaisesRegex(AttributeError, expected_error):
option.set({"bin_count_or_method.is_enabled": True})

# Treat num_quantiles as a BooleanOption
expected_error = "type object 'num_quantiles' has no attribute " "'is_enabled'"
Copy link
Contributor

Choose a reason for hiding this comment

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

fix this spacing

Comment on lines 1841 to 1844
int_options = FloatOptions()
int_options.histogram_and_quantiles.bin_count_or_method = 5
int_options.histogram_and_quantiles.num_quantiles = 4
profiler = FloatColumn("0.0", int_options)
Copy link
Contributor

Choose a reason for hiding this comment

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

😢 bad naming.... but we should fix in this PR

Comment on lines +1841 to +1844
float_options = FloatOptions()
float_options.histogram_and_quantiles.bin_count_or_method = 5
float_options.histogram_and_quantiles.num_quantiles = 4
profiler = FloatColumn("0.0", float_options)
Copy link
Contributor

Choose a reason for hiding this comment

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

beauty!

@taylorfturner taylorfturner enabled auto-merge (squash) July 20, 2023 21:21
@taylorfturner taylorfturner merged commit 5bd8a9e into capitalone:feature/num-quantiles Jul 20, 2023
@clee1152
Copy link
Contributor Author

clee1152 commented Aug 1, 2023

#853

taylorfturner added a commit that referenced this pull request Aug 1, 2023
…nt `num_quantiles` option to `HistogramAndQuantilesOptions` (#956)

* Implemented options for `num_quantiles` feature in `NumericStatsMixin`

* Implemented options for `num_quantiles.py`.

* Added tests for `num_quantiles`.

* Fixed tests for num_quantiles option in column profiles.

* Added tests for num_quantiles option.

* Update dataprofiler/tests/profilers/profiler_options/test_num_quantiles_option.py

Co-authored-by: Taylor Turner <[email protected]>

* Minor edits to tests

* Empty commit

* Precommits

* Minor change to Makefile.

* Got rid of print statements.

* "empty commit"

* Added deprecation for `HistogramOption`.

* Cleaner deprecation: removed `HistogramOption` class.

* json_decoder, test_h_a_q changes.

* Fixed string bug for testing in test_histogram_and_quantiles

* Explicitfied deprecation warning, validated profile conversion from histogramoption to histogramandquantilesoption in decoding phase.

* Minor deprecation warning  wording change.

* Update dataprofiler/tests/profilers/profiler_options/test_histogram_and_quantiles_option.py

Co-authored-by: Taylor Turner <[email protected]>

* Changed deprecation warning.

* Changed quantiles option to initialize to None.

* Minor change

* Minor change again D:

* Minor change again again D: sadness

---------

Co-authored-by: Taylor Turner <[email protected]>
clee1152 added a commit to clee1152/DataProfiler that referenced this pull request Aug 1, 2023
…nt `num_quantiles` option to `HistogramAndQuantilesOptions` (capitalone#956)

* Implemented options for `num_quantiles` feature in `NumericStatsMixin`

* Implemented options for `num_quantiles.py`.

* Added tests for `num_quantiles`.

* Fixed tests for num_quantiles option in column profiles.

* Added tests for num_quantiles option.

* Update dataprofiler/tests/profilers/profiler_options/test_num_quantiles_option.py

Co-authored-by: Taylor Turner <[email protected]>

* Minor edits to tests

* Empty commit

* Precommits

* Minor change to Makefile.

* Got rid of print statements.

* "empty commit"

* Added deprecation for `HistogramOption`.

* Cleaner deprecation: removed `HistogramOption` class.

* json_decoder, test_h_a_q changes.

* Fixed string bug for testing in test_histogram_and_quantiles

* Explicitfied deprecation warning, validated profile conversion from histogramoption to histogramandquantilesoption in decoding phase.

* Minor deprecation warning  wording change.

* Update dataprofiler/tests/profilers/profiler_options/test_histogram_and_quantiles_option.py

Co-authored-by: Taylor Turner <[email protected]>

* Changed deprecation warning.

* Changed quantiles option to initialize to None.

* Minor change

* Minor change again D:

* Minor change again again D: sadness

---------

Co-authored-by: Taylor Turner <[email protected]>
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.

4 participants