Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Fix table_cache when disable_table_cache is set to True #375

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

josescuderoh
Copy link

@josescuderoh josescuderoh commented May 29, 2023

Problem

Describe the problem your PR is trying to solve

When setting disable_table_cache to True the target throws the following error when trying to retrieve the file_format_type from the db object.

UnboundLocalError: local variable 'db' referenced before assignment

Proposed changes

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
If it fixes a bug or resolves a feature request, be sure to link to that issue.

With this change, we define the db object outside of the if statement to avoid the above error. We also set the default value of table_cache=None as defined in persist_lines and DbSync class.

Types of changes

What types of changes does your code introduce to PipelineWise?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

  • Description above provides context of the change
  • I have added tests that prove my fix is effective or that my feature works
  • Unit tests for changes (not needed for documentation changes)
  • CI checks pass with my changes
  • Bumping version in setup.py is an individual PR and not mixed with feature or bugfix PRs
  • Commit message/PR title starts with [AP-NNNN] (if applicable. AP-NNNN = JIRA ID)
  • Branch name starts with AP-NNN (if applicable. AP-NNN = JIRA ID)
  • Commits follow "How to write a good git commit message"
  • Relevant documentation is updated including usage instructions

@josescuderoh
Copy link
Author

@jeet-parekh-wise @Samira-El @louis-pie would it be possible for you to review this small fix?

josescuderoh added a commit to shakepay/pipelinewise-target-snowflake that referenced this pull request Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant