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(ingest/mssql): remove lower() method from sql_common get_db_name #10773

Conversation

sleeperdeep
Copy link
Contributor

@sleeperdeep sleeperdeep commented Jun 25, 2024

Closes #9857

Summary by CodeRabbit

  • Documentation

    • Updated the updating-datahub.md document to reflect significant changes in the DataHub system, including URN migration and breaking changes across versions.
  • New Features

    • Introduced new parameters in CLI commands and enhanced Tableau ingestion.
    • Added new dataset entries for various dimensions and facts in the Vertica database.
  • Bug Fixes

    • Addressed inconsistencies in entity URN values and database name capitalizations across multiple integrations.
  • Chores

    • Updated metadata structure for improved consistency and clarity in naming conventions.

@github-actions github-actions bot added ingestion PR or Issue related to the ingestion of metadata community-contribution PR or Issue raised by member(s) of DataHub Community labels Jun 25, 2024
@sleeperdeep
Copy link
Contributor Author

@mayurinehate @hsheth2
Sorry guys, I made mistake and discarded all commits from previous PR. I created new one.

Copy link
Collaborator

@mayurinehate mayurinehate left a comment

Choose a reason for hiding this comment

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

Mostly looks good. Minor change suggested in example in doc.


Old `urn`, where `data_base_name` is `Some_Database`:
```
- urn:li:dataset:(urn:li:dataPlatform:paltform,some_database.schema.entitie,ENV)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- urn:li:dataset:(urn:li:dataPlatform:paltform,some_database.schema.entitie,ENV)
- urn:li:dataJob:(urn:li:dataFlow:(mssql,demodata.Foo.stored_procedures,PROD),Proc.With.SpecialChar)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's change the example to be of dataJob as only dataJob and container URNs have changed and not that of dataset.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

```
New `urn`, where `data_base_name` is `Some_Database`:
```
- urn:li:dataset:(urn:li:dataPlatform:paltform,Some_Database.schema.entitie,ENV)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- urn:li:dataset:(urn:li:dataPlatform:paltform,Some_Database.schema.entitie,ENV)
- urn:li:dataJob:(urn:li:dataFlow:(mssql,DemoData.Foo.stored_procedures,PROD),Proc.With.SpecialChar)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

… add description updating-datahub (with dataJob urns)
Copy link
Collaborator

@mayurinehate mayurinehate left a comment

Choose a reason for hiding this comment

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

LGTM

@sleeperdeep
Copy link
Contributor Author

@mayurinehate Thanks.
@hsheth2 sorry for my mistake, can you, please, look at this PR one more time?

@hsheth2 hsheth2 added the merge-pending-ci A PR that has passed review and should be merged once CI is green. label Jul 8, 2024
@sleeperdeep
Copy link
Contributor Author

@hsheth2 @mayurinehate
Hi guys! Can we merge this changes or something is not ok with it?

@sleeperdeep sleeperdeep force-pushed the feature/fix_sql_common_get_db_name_method branch from b4af3cc to aa4061a Compare August 30, 2024 09:05
Copy link
Contributor

coderabbitai bot commented Aug 30, 2024

Walkthrough

The pull request introduces significant updates to the DataHub system, particularly affecting the SQLAlchemySource class. The .lower() method has been removed from the get_db_name function, which impacts how database names are managed, requiring a migration to preserve original casing in URNs. The documentation has been revised to reflect various breaking changes, including updates to Protobuf CLI, OpenAPI specifications, and configuration requirements for the Glue source. Additionally, multiple JSON files have been updated to ensure consistency in entity URNs and naming conventions across different database contexts.

Changes

File Change Summary
docs/how/updating-datahub.md Updated to reflect removal of lower method from get_db_name, breaking changes, and new configurations for DataHub.
metadata-ingestion/src/datahub/ingestion/source/sql/sql_common.py Modified get_db_name method to remove .lower() call, affecting database name casing; updated comments and logging.
metadata-ingestion/tests/integration/oracle/golden_test_ingest_with_database.json
metadata-ingestion/tests/integration/oracle/golden_test_ingest_with_out_database.json
Updated entityUrn values and casing for database and name fields in multiple containers and datasets.
metadata-ingestion/tests/integration/sql_server/golden_files/golden_mces_mssql_no_db_to_file.json
metadata-ingestion/tests/integration/sql_server/golden_files/golden_mces_mssql_no_db_with_filter.json
metadata-ingestion/tests/integration/sql_server/golden_files/golden_mces_mssql_to_file.json
metadata-ingestion/tests/integration/sql_server/golden_files/golden_mces_mssql_with_lower_case_urn.json
Updated entityUrn values and database/schema names for consistency; modified aspects to reflect new naming conventions.
metadata-ingestion/tests/integration/vertica/vertica_mces_with_db_golden.json Updated entityUrn values, modified database name casing, and added new properties for containers and datasets.

Assessment against linked issues

Objective Addressed Explanation
Remove .lower() from get_db_name to fix URN casing inconsistency (#9857)
Ensure URNs retain original casing across all relevant classes (#9857)

Possibly related PRs

Suggested reviewers

  • hsheth2

Poem

🐇 In the garden where data flows,
A rabbit hops where the metadata grows.
With URNs bright, in their true case,
We celebrate changes, a joyful embrace!
No more lowercase, let the names shine,
In DataHub's realm, all is now fine! 🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sleeperdeep
Copy link
Contributor Author

@hsheth2 How to reopen this PR back? Branch is still exists.

@sleeperdeep sleeperdeep reopened this Sep 2, 2024
@github-actions github-actions bot added docs Issues and Improvements to docs product PR or Issue related to the DataHub UI/UX devops PR or Issue related to DataHub backend & deployment labels Sep 2, 2024
@sleeperdeep
Copy link
Contributor Author

@hsheth2 @mayurinehate
is failure of 'documentation / gh-pages' known issue or I should fix some else with current PR?

@hsheth2 hsheth2 merged commit e34a628 into datahub-project:master Sep 3, 2024
67 of 68 checks passed
@hsheth2
Copy link
Collaborator

hsheth2 commented Sep 3, 2024

@sleeperdeep the gh-pages one looked unrelated, so I've merged this in.

@maggiehays
Copy link
Collaborator

@coderabbitai summary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution PR or Issue raised by member(s) of DataHub Community devops PR or Issue related to DataHub backend & deployment docs Issues and Improvements to docs ingestion PR or Issue related to the ingestion of metadata merge-pending-ci A PR that has passed review and should be merged once CI is green. product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

convert_urns_to_lowercase: inconsistency of usage in SQLAlchemySource.get_db & get_identifier methods
4 participants