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(ingestion): validate datasource in Tableau connector, before creating its upstream #4613

Merged

Conversation

nandacamargo
Copy link
Contributor

Checklist

Hi!

We are using Datahub Tableau connector and we are facing an issue when ingesting some Tableau data sources, as shown below:

File "/usr/local/lib/python3.8/site-packages/datahub/ingestion/source/tableau.py", line 324, in emit_custom_sql_datasources
    yield from self._create_lineage_from_csql_datasource(
File "/usr/local/lib/python3.8/site-packages/datahub/ingestion/source/tableau.py", line 397, in _create_lineage_from_csql_datasource
    self.platform, datasource.get("id", ""), self.config.env

AttributeError: 'NoneType' object has no attribute 'get'

This is happening because datasource is None and this PR adds a validation that fix this issue.

For the ingestion, we were testing with the following Datahub versions: 0.8.31 and 0.8.32.

Thank you!

@github-actions
Copy link

github-actions bot commented Apr 7, 2022

Unit Test Results (build & test)

  96 files  ±0    96 suites  ±0   23m 39s ⏱️ + 8m 24s
689 tests ±0  630 ✔️ ±0  59 💤 ±0  0 ±0 

Results for commit c99dba0. ± Comparison against base commit 5637e73.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Apr 7, 2022

Unit Test Results (metadata ingestion)

       5 files  ±    0         5 suites  ±0   54m 59s ⏱️ + 33m 20s
   429 tests +  33     424 ✔️ +  45    0 💤 ±0  0  - 12  5 🔥 ±0 
2 070 runs  +159  2 019 ✔️ +186  46 💤 +2  0  - 24  5 🔥  - 5 

For more details on these errors, see this check.

Results for commit c99dba0. ± Comparison against base commit 5637e73.

♻️ This comment has been updated with latest results.

@treff7es
Copy link
Contributor

treff7es commented Apr 8, 2022

@mayurinehate please take a look

@treff7es treff7es self-assigned this Apr 11, 2022
@mayurinehate
Copy link
Collaborator

Hey, thanks for raising the PR. I would like to suggest a change in the PR - to fix the cause of this error at its source.
I believe, simply adding a none check before adding datasource in csql's datasources at these lines https://github.com/datahub-project/datahub/blob/master/metadata-ingestion/src/datahub/ingestion/source/tableau_common.py#L478-L479 will fix the problem and existing changes in tableau.py can be reverted.

* Check before appending to datasource_for_csql
Copy link
Contributor

@shirshanka shirshanka left a comment

Choose a reason for hiding this comment

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

LGTM!

@shirshanka shirshanka merged commit d508f5c into datahub-project:master Apr 14, 2022
maggiehays pushed a commit to maggiehays/datahub that referenced this pull request Aug 1, 2022
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