Skip to content

Conversation

@dolfinus
Copy link
Member

Change Summary

Actually, onETL hooks can detect that they were called from inherited class, and not from main class.

Related issue number

Checklist

  • Commit message and PR title is comprehensive
  • Keep the change as small as possible
  • Unit and integration tests for the changes exist
  • Tests pass on CI and coverage does not decrease
  • Documentation reflects the changes where applicable
  • docs/changelog/next_release/<pull request or issue id>.<change type>.rst file added describing change
    (see CONTRIBUTING.rst for details.)
  • My PR is ready to review.

@dolfinus dolfinus requested a review from marashka October 29, 2025 14:29
@dolfinus dolfinus self-assigned this Oct 29, 2025
@dolfinus dolfinus force-pushed the improvement/DOP-28167 branch from 384b018 to 6512a4a Compare October 29, 2025 14:39
@dolfinus dolfinus added the ci:skip-changelog Add this label to skip changelog file check label Oct 29, 2025
@github-actions
Copy link

Coverage

Coverage Report •
FileStmtsMissCoverMissing
syncmaster/worker/handlers/db
   hive.py42197%58
   iceberg.py362044%29, 53–55, 58–62, 64–66, 68–71, 73, 75, 78, 81
   mssql.py32196%58
   mysql.py34197%55
   oracle.py34197%59
syncmaster/worker/handlers/file
   local_df.py69297%57, 61
   remote_df.py31293%36, 40
TOTAL494730193% 

Copy link
Contributor

@marashka marashka left a comment

Choose a reason for hiding this comment

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

You're right, but inheritance also inherits connected hooks, and we don't need this for open liniage, we want to have separate liniage logic for each database.

Check this out:

`from onetl.hooks import hook, slot, support_hooks

@support_hooks
class SomeTestHook:
@slot
def test_method(self):
return "Hello"

class NewHook(SomeTestHook):
pass

@SomeTestHook.test_method.bind
@hook
def open_liniage_event_1(self):
print("Hook event 1")

@NewHook.test_method.bind
@hook
def open_liniage_even_2(self):
print("Hook event 2")

SomeTestHook().test_method()`

@dolfinus dolfinus closed this Oct 29, 2025
@dolfinus dolfinus deleted the improvement/DOP-28167 branch October 29, 2025 14:57
@dolfinus
Copy link
Member Author

Oh, I see

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:skip-changelog Add this label to skip changelog file check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants