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

Smooth Validation and Profiling Performance #619

Merged
merged 10 commits into from
Aug 16, 2019

Conversation

jcampbell
Copy link
Member

This PR addresses issues related to performance and ease of profiling larger datasets.

  1. UDFs are removed from sparkdf_dataset where possible
  2. Logging is more terse in cases where we correctly identify a problem during evaluating cardinality.

In addition, this PR changes validation by default to detect column-type expectations and group them. This is nearly zero-cost in all circumstances and can speed up cases where iterating over the same column has a cache benefit. It also demonstrates how using a ValidationOperator may affect validation order or other characteristics.

eugmandel
eugmandel previously approved these changes Aug 15, 2019
@coveralls
Copy link

coveralls commented Aug 16, 2019

Coverage Status

Coverage increased (+0.006%) to 81.437% when pulling f103be9 on feature/spark_optimization into 5852b5d on develop.

Copy link
Member

@abegong abegong left a comment

Choose a reason for hiding this comment

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

👍

return column.withColumn('__success', success_udf(column[0]))
if None in value_set:
# spark isin returns None when any value is compared to None
logger.error("expect_column_values_to_be_in_set cannot support a None in the value_set in spark")
Copy link
Member

Choose a reason for hiding this comment

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

such nice error messages

{'expectation_type': 'expect_column_values_to_be_in_set',
'kwargs': {'column': 'D', 'value_set': ['e', 'f', 'g', 'h']}}
]

sub1 = df[:3]

sub1.discard_failing_expectations()
self.assertEqual(sub1.find_expectations(), exp1)
# PY2 sorting is allowed and order not guaranteed
Copy link
Member

Choose a reason for hiding this comment

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

Feels like sorting is a function that ExpectationSuite.get_config (or similar) should eventually handle.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

@jcampbell jcampbell merged commit 6787796 into develop Aug 16, 2019
@jcampbell jcampbell deleted the feature/spark_optimization branch August 16, 2019 23:46
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.

None yet

4 participants