Closed naresh251 closed 5 months ago
Hey @naresh251. I think you missed adding the backticks to make your code render as code in the issue. That said, I have a few thoughts on your issue:
Can you try changing:
extracts = [i for i in all_extracts if (i.target.id == datasource_id) and ('IncrementExtractViaBridgeTask' == i.task_type)]
to
extracts = [i for i in all_extracts if ('IncrementExtractViaBridgeTask' == i.task_type) and (i.target.id == datasource_id)]
Python implicitly does short-circuit evaluation, so if the first condition is False
it never evaluates the second. In the code you provided, it is checking if the target.id == datasource_id
before it checks if the task type is 'IncrementExtractViaBridgeTask'
. By flipping the conditions around, it will check if the task type is correct before it tries to compare the target id, which may eliminate that NoneType
error.
hey @jorwoods thanks for checking. Issue got fixed by condition i.target is not None.
extracts = [i for i in all_extracts if (i.target is not None and i.target.id == datasource_id) and ('IncrementExtractViaBridgeTask' == i.task_type)]
Closed as solved based on discussion above.
Describe the bug A clear and concise description of what the bug is.
Versions Details of your environment, including:
To Reproduce Steps to reproduce the behavior. Please include a code snippet where possible.
Results What are the results or error messages received?