Skip to content

Conversation

@narenderqlik
Copy link

Description of change

Add New Metadata to tap
SAC-28854

Risks

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

@RushiT0122 RushiT0122 requested a review from Copilot October 9, 2025 12:41
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds new metadata configuration to the Listrak tap by introducing forced replication methods for all supported streams.

  • Adds a REPLICATION_METHODS dictionary mapping all streams to FULL_TABLE replication
  • Creates a CustomCatalogEntry class that extends the standard CatalogEntry with forced replication method support
  • Updates the discovery process to use the custom catalog entry with predefined replication methods

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tap_listrak/schemas.py Defines replication methods dictionary mapping all streams to FULL_TABLE
tap_listrak/init.py Implements CustomCatalogEntry class and updates discovery to use forced replication methods

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

class CustomCatalogEntry(CatalogEntry):

def __init__(self, *args, forced_replication_method=None, **kwargs):
self.forced_replication_method = kwargs.pop('forced_replication_method', forced_replication_method)
Copy link

Copilot AI Oct 9, 2025

Choose a reason for hiding this comment

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

The parameter handling is redundant. The kwargs.pop() call with the same default value as the parameter creates unnecessary complexity. Consider simplifying to self.forced_replication_method = forced_replication_method.

Suggested change
self.forced_replication_method = kwargs.pop('forced_replication_method', forced_replication_method)
self.forced_replication_method = forced_replication_method

Copilot uses AI. Check for mistakes.

Choose a reason for hiding this comment

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

Take care of this review as well.

Copy link
Author

Choose a reason for hiding this comment

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

added the changes

def to_dict(self):
result = super().to_dict()
if self.forced_replication_method is not None:
result['forced_replication_method'] = self.forced_replication_method

Choose a reason for hiding this comment

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

Suggested change
result['forced_replication_method'] = self.forced_replication_method
result['forced-replication-method'] = self.forced_replication_method

Copy link
Author

Choose a reason for hiding this comment

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

Made the changes

class CustomCatalogEntry(CatalogEntry):

def __init__(self, *args, forced_replication_method=None, **kwargs):
self.forced_replication_method = kwargs.pop('forced_replication_method', forced_replication_method)

Choose a reason for hiding this comment

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

Take care of this review as well.

Copy link

@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.

get_standard_metadata is already used in this tap. There was no need to add new class CustomCatalogEntry.

CHANGELOG.md Outdated
# Changelog

## 1.2.0
* forced replication method to metadata [#25](https://github.com/singer-io/tap-listrak/pull/25)

Choose a reason for hiding this comment

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

Suggested change
* forced replication method to metadata [#25](https://github.com/singer-io/tap-listrak/pull/25)
* Add forced replication method to metadata [#25](https://github.com/singer-io/tap-listrak/pull/25)

Copy link

@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.

Added minor correction in the changelog, otherwise changes look good so approved the PR. Please fix comment before merging the changes.

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