OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

Fix OpenLineage ingestor

Open dolfinus opened this issue 1 year ago • 1 comments

Describe your changes:

OpenLineage ingestion wasn't updated to include changes from #15201 and #15130. Ingestion failed with errors like:

[2024-05-24, 15:14:18 UTC] {taskinstance.py:1937} ERROR - Task failed with exception
Traceback (most recent call last):
  File "/home/airflow/.local/lib/python3.10/site-packages/airflow/operators/python.py", line 192, in execute
    return_value = self.execute_callable()
  File "/home/airflow/.local/lib/python3.10/site-packages/airflow/operators/python.py", line 209, in execute_callable
    return self.python_callable(*self.op_args, **self.op_kwargs)
  File "/home/airflow/.local/lib/python3.10/site-packages/openmetadata_managed_apis/workflows/ingestion/common.py", line 207, in metadata_ingestion_workflow
    workflow = MetadataWorkflow.create(config)
  File "/home/airflow/.local/lib/python3.10/site-packages/metadata/workflow/ingestion.py", line 103, in create
    return cls(config)
  File "/home/airflow/.local/lib/python3.10/site-packages/metadata/workflow/ingestion.py", line 79, in __init__
    super().__init__(
  File "/home/airflow/.local/lib/python3.10/site-packages/metadata/workflow/base.py", line 107, in __init__
    self.post_init()
  File "/home/airflow/.local/lib/python3.10/site-packages/metadata/workflow/ingestion.py", line 98, in post_init
    self.set_steps()
  File "/home/airflow/.local/lib/python3.10/site-packages/metadata/workflow/metadata.py", line 35, in set_steps
    self.source = self._get_source()
  File "/home/airflow/.local/lib/python3.10/site-packages/metadata/workflow/metadata.py", line 66, in _get_source
    source: Source = source_class.create(
TypeError: OpenlineageSource.create() takes 3 positional arguments but 4 were given
[2024-05-24, 14:00:05 UTC] {step.py:230} WARNING - Object type defined in `def _iter()` /home/airflow/.local/lib/python3.10/site-packages/metadata/ingestion/api/topology_runner.py is not an Either: ['TopologyContextManager' object has no attribute 'pipeline']
[2024-05-24, 14:00:05 UTC] {status.py:76} WARNING - Object type defined in `def _iter()` /home/airflow/.local/lib/python3.10/site-packages/metadata/ingestion/api/topology_runner.py is not an Either: ['TopologyContextManager' object has no attribute 'pipeline']

Updated OpenLineage ingestor code to include from #15201 and #15130.

Type of change:

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

Checklist:

  • [x] 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.

dolfinus avatar May 24 '24 15:05 dolfinus

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

github-actions[bot] avatar May 24 '24 15:05 github-actions[bot]

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.

github-actions[bot] avatar May 27 '24 05:05 github-actions[bot]