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

MINOR: Refactor output_handlers to a WorkflowOutputHandler class #17149

Merged
merged 9 commits into from
Jul 29, 2024

Conversation

IceS2
Copy link
Contributor

@IceS2 IceS2 commented Jul 23, 2024

Small refactor to reduce the amount of code and dependencies we have for the Workflows.
Instead of having output_handler.py, application_output_handler.py and workflow_output_handler.py files dealing with different parts of the output now we have it merged in one WorkflowOutputHandler class that will be instantiated when a Workflow is created.

This way the workflow is responsible for printing it's own status and summary with the help of this class instead of having both of them depending on each other.

TODO:

  • Create print_status(workflow) function to avoid breaking user's current scripts. Add a deprecation notice with the information on which release will be removed
  • Review the functions in workflow_output_handler that are not within the class
    • Extracted WorkflowInitErrorHandler from the workflow_output_handler.py file to keep the flow within a context.
  • Uncomment the workflow_output_handler.py file from basedpyright and fix any issues
  • Review/Add Tests

Type of change:

  • Improvement

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

Copy link
Contributor

Phylum OSS Supply Chain Risk Analysis - SUCCESS

The Phylum risk analysis is complete and has passed the active policy.

View this project in the Phylum UI

Copy link
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check 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.

Copy link
Contributor

@TeddyCr TeddyCr left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @IceS2, left a few comments/questions

Copy link

sonarcloud bot commented Jul 26, 2024

Quality Gate Passed Quality Gate passed for 'open-metadata-airflow-apis'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Jul 26, 2024

@IceS2 IceS2 merged commit c522f14 into main Jul 29, 2024
30 of 32 checks passed
@IceS2 IceS2 deleted the iterate-on-pyright branch July 29, 2024 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation Ingestion safe to test Add this label to run secure Github workflows on PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants