Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

target-redshift wrongly transforming single-quote to double-quote #23

Closed
afonsodiniz opened this issue Apr 18, 2024 · 2 comments · Fixed by #48
Closed

target-redshift wrongly transforming single-quote to double-quote #23

afonsodiniz opened this issue Apr 18, 2024 · 2 comments · Fixed by #48

Comments

@afonsodiniz
Copy link

afonsodiniz commented Apr 18, 2024

Describe the bug
Hi,

I'm using Meltano to integrate Jira data into our Redshift datawarehouse.

Tap used for get data:

I have a column from Jira's Changelogs entity that is a Json array and below you can see an example of one:

[{"field": "summary", "fieldtype": "jira", "fieldId": "summary", "from": null, "fromString": null, "to": null, "toString": "A'Test Company"}]

When I run meltano --log-level=debug run tap-jira target-redshift what is written in the table is:

[{"field": "summary", "fieldtype": "jira", "fieldId": "summary", "from": null, "fromString": null, "to": null, "toString": "A"Test Company"}] with ", instead of ', which makes my pipeline to break.

To debug the issue:

  • Check if was tap-jira issue: ran meltano invoke tap-jira > json.txt, which correctly wrote row "A'Test Company"

  • ran meltano invoke tap-jira > json.txt, which correctly wrote row "A'Test Company"

I've looked into the code repo and I found this, that might be causing the problem:

{key: str(value).replace("'", '"').replace("None", "") for key, value in record.items()}

To Reproduce
Steps to reproduce the behavior:

  1. meltano install tap-jira
  2. meltano install target-redshift
  3. configure both tap and target
  4. run: meltano --log-level=debug run tap-jira target-redshift

Expected behavior
The expected behavior would be the exact same row outputed from tap, be inserted on redshift.

Desktop (please complete the following information):

  • OS: macOS 14.2 (23C64)
  • Browser: Chrome

Additional context
This is actually making my pipelines to break and I'd be really appreciated if this can be taken into account ASAP.

Thanks in advance.

@edgarrmondragon
Copy link

@tobiascadee any interest in a PR to address this?

@tobiascadee
Copy link
Contributor

tobiascadee commented May 21, 2024

Hi! Sorry I was on parental leave for 4 weeks. I definitely have an interest in a PR to fix this. although it is a bit of a tough issue. When not using schema flattening quoting can break the s3 copy action in some cases. But I would be happy to review a possible solution!

@afonsodiniz could you include the error message?

@tobiascadee tobiascadee linked a pull request May 21, 2024 that will close this issue
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 a pull request may close this issue.

3 participants