Skip to content

Conversation

@Code-Eat-Rabbit
Copy link
Owner

Describe your changes:

Fixes

I worked on fixing the owner inheritance mechanism within the ingestion module. The previous implementation failed to correctly apply inherited owners for schemas and tables (e.g., test-05 scenario where finance_db.treasury tables incorrectly defaulted to data-platform-team instead of treasury-team). This was due to the context attempting to retrieve full entity objects (database_entity, database_schema_entity) which were not present, leading to a broken inheritance chain.

My changes involve:

  1. Storing the database_owner and schema_owner names directly into the context during the yield_database and yield_database_schema processes in common_db_source.py.
  2. Modifying get_schema_owner_ref and get_owner_ref in database_service.py to retrieve these owner names directly from the context, ensuring the correct inheritance hierarchy (explicitly defined owner > schema owner > database owner > default owner).
  3. Implementing logic to clear context owner fields when processing new entities to prevent residual data.

These modifications were made to resolve the inheritance bug by operating on owner names stored in the context, without altering generic infrastructure files like topology_runner.py.

I tested my changes by running the test-05-inheritance-enabled.yaml ingestion test. The test now passes, with tables under finance_db.treasury correctly inheriting treasury-team and tables under finance_db.accounting inheriting finance-team, as per the defined inheritance rules.

Type of change:

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

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.
  • I have added a test that covers the exact scenario we are fixing. For complex issues, comment the issue number in the test for future reference.

Open in Cursor Open in Web

Co-authored-by: yourton.ma <yourton.ma@gmail.com>
@cursor
Copy link

cursor bot commented Oct 12, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@github-actions
Copy link

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!

@Code-Eat-Rabbit Code-Eat-Rabbit marked this pull request as ready for review October 12, 2025 07:24
@cursor
Copy link

cursor bot commented Oct 12, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on November 27.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

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.

3 participants