Skip to content

changes for the meta data to add the forced replication key #27

Open
narenderqlik wants to merge 3 commits intolibrary-updatesfrom
SAC-28823-metadata-to-tap
Open

changes for the meta data to add the forced replication key #27
narenderqlik wants to merge 3 commits intolibrary-updatesfrom
SAC-28823-metadata-to-tap

Conversation

@narenderqlik
Copy link
Copy Markdown

Description of change

Add New Metadata to tap-codat
SAC-28823

Changes :

  1. forced-replication-method as there is no code for it
  2. added the logic to get the parent-tap-stream-id as we have sub stream relationship

AI generated code

https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code

  • this PR has been written with the help of GitHub Copilot or another generative AI tool

Comment thread tap_codat/__init__.py Outdated
schema = Schema.from_dict(schema_dict)
mdata = metadata.get_standard_metadata(schema_dict,
key_properties=stream.pk_fields)
mdata = metadata.get_standard_metadata(schema_dict,key_properties=stream.pk_fields, replication_method="FULL_TABLE")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why is it hard-coded?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The replication method is hard-coded as "FULL_TABLE" because the stream details don’t currently include a replication method. To make it dynamic, we'd need to update the stream metadata to include this info, and then fetch it from there.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You can add FULL_TABLE as default replication method in Stream class and generalize the implementation.

Copy link
Copy Markdown
Author

@narenderqlik narenderqlik Oct 3, 2025

Choose a reason for hiding this comment

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

I have added the replication_method key in the stream class to get the dynamic replication method for for all the streams.

Copy link
Copy Markdown

@RushiT0122 RushiT0122 left a comment

Choose a reason for hiding this comment

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

I see at least 18 children of companies table. Reverify the implementation and make appropriate changes.

Comment thread tap_codat/__init__.py Outdated
Comment on lines +51 to +52
if hasattr(stream, 'parent_stream') and stream.parent_stream:
mdata = metadata.write(mdata, (), 'parent-tap-stream-id', stream.parent_stream.tap_stream_id)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
if hasattr(stream, 'parent_stream') and stream.parent_stream:
mdata = metadata.write(mdata, (), 'parent-tap-stream-id', stream.parent_stream.tap_stream_id)
if getattr(stream, `parent_stream`, None):
mdata = metadata.write(mdata, (), 'parent-tap-stream-id', stream.parent_stream.tap_stream_id)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have made the changes. please verify once

@RushiT0122 RushiT0122 self-requested a review October 3, 2025 16:08
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.

2 participants