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 #2875 - Profiler API Sink #3011

Merged
merged 62 commits into from Mar 2, 2022
Merged

Conversation

pmbrull
Copy link
Collaborator

@pmbrull pmbrull commented Feb 28, 2022

Describe your changes :

This PR fixes #2875

We have removed the deprecated grammar approach to validation definitions and instead, use pydantic models coming from the API. These changes can be seen in validations/core.py.

The ORM Processor now handles these typed tests and returns TestCaseResult to be updated in the Sink.

Regarding test definition, we support both adding tests directly as part of the workflow config or externally via the API. In both cases, we handle the tests for each record and run them. If the tests are added in the workflow, they will be PUT in the sink as well to update the Table Entity.

To handle test APIs, we have updated the OMeta Python API with the required methods

Type of change :

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Frontend Preview (Screenshots) :

For frontend related change, please link screenshots of your changes preview! Optional for backend related changes.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my own.
  • I have tagged my reviewers below.
  • I have commented on my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.
  • I have added tests that prove my fix is effective or that my feature works.
  • All new and existing tests passed.

Reviewers


if record.record_tests:
for table_test in record.record_tests.table_tests:
self.metadata.add_table_test(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Update test definitions and add testCaseResult info

logger = logger()


def column_values_to_be_between(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sample test case implementation

"""
The required Metric is not available in the profiler results
@singledispatch
def validate(test_case, *args, **kwargs) -> TestCaseResult:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Generic function to handle all test implementations

@pmbrull
Copy link
Collaborator Author

pmbrull commented Feb 28, 2022

Opened #3012 to handle py-tests issue from the last few PRs. Some dependency updates broke the airflow db init command. Looking into it

@pmbrull
Copy link
Collaborator Author

pmbrull commented Feb 28, 2022

For some reason, a class that gets generated for me as Status1 is not being picked up in the CI. Checking. Ci now runs though, which is great

@github-actions
Copy link

github-actions bot commented Mar 2, 2022

The Python checkstyle failed.

Please run make py_format in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@open-metadata open-metadata deleted a comment from github-actions bot Mar 2, 2022
@open-metadata open-metadata deleted a comment from github-actions bot Mar 2, 2022
@open-metadata open-metadata deleted a comment from github-actions bot Mar 2, 2022
@pmbrull pmbrull merged commit 71207de into open-metadata:main Mar 2, 2022
@sonarcloud
Copy link

sonarcloud bot commented Mar 2, 2022

[open-metadata-ingestion] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

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.

Build profiler sink
2 participants