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(tableau): fixes some aspects being emitted multiple times #12258

Merged

Conversation

sgomezvillamor
Copy link
Contributor

When working with the Tableau API, this fix prevents duplicate values in query filters for certain queries. Duplicates in the query lead to duplicates in the result, causing some aspects to be emitted multiple times.

I've verified this beyond unit tests by running a local Tableau ingestion. On the left, you see the results with the master code, and on the right, results with the fix. Notably, counters like chart.status remain 57 in both scenarios, but many chart aspects are nearly doubled on the left. The same goes for dashboard and dataset aspects.

Screenshot 2025-01-02 at 16 42 22

I pushed down this optimization as much as possible, to avoid dependency on the callers of get_connection_objects needing to be aware of it.

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the ingestion PR or Issue related to the ingestion of metadata label Jan 2, 2025
@datahub-cyborg datahub-cyborg bot added the needs-review Label for PRs that need review from a maintainer. label Jan 2, 2025
@sgomezvillamor sgomezvillamor requested review from hsheth2 and mayurinehate and removed request for hsheth2 January 2, 2025 15:54
optimized_query = copy.deepcopy(query_filter)

if query_filter.get(c.ID_WITH_IN):
optimized_query[c.ID_WITH_IN] = list(set(query_filter[c.ID_WITH_IN]))
Copy link
Collaborator

Choose a reason for hiding this comment

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

could we use our OrderedSet type here? mainly to ensure consistent behavior across runs and make testing/mocking easier

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done in commit 877a50a

@datahub-cyborg datahub-cyborg bot added pending-submitter-merge and removed needs-review Label for PRs that need review from a maintainer. labels Jan 2, 2025
@sgomezvillamor sgomezvillamor merged commit 1190dd9 into master Jan 3, 2025
80 checks passed
@sgomezvillamor sgomezvillamor deleted the feature/cus-3546-fix-tableau-duplicate-query-ids branch January 3, 2025 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ingestion PR or Issue related to the ingestion of metadata pending-submitter-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants