Hi team, I'm using tap-mysql to read from mariadb ...
# troubleshooting
r
Hi team, I'm using tap-mysql to read from mariadb One of the stream got property of TIME data type with value
08:30:00
Then I got this error
Copy code
time=2024-08-06 13:30:42 name=singer level=INFO message=METRIC: {"type": "timer", "metric": "job_duration", "value": 0.06214737892150879, "tags": {"job_type": "sync_table", "database": "", "table": "", "status": "succeeded"}} cmd_type=elb consumer=False job_name=dev:tap-mysql-to-target-postgres name=tap-mysql producer=True run_id=e3d8d66d-433b-4aef-a710-36b824334e4b stdio=stderr string_id=tap-mysql
2024-08-06T06:30:42.225210Z [info     ]     date_val = time_fromisoformat(date_val) cmd_type=elb consumer=True job_name=dev:tap-mysql-to-target-postgres name=target-postgres producer=False run_id=e3d8d66d-433b-4aef-a710-36b824334e4b stdio=stderr string_id=target-postgres
2024-08-06T06:30:42.225210Z [info     ]                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cmd_type=elb consumer=True job_name=dev:tap-mysql-to-target-postgres name=target-postgres producer=False run_id=e3d8d66d-433b-4aef-a710-36b824334e4b stdio=stderr string_id=target-postgres
2024-08-06T06:30:42.225210Z [info     ] ValueError: Invalid isoformat string: '8:30:00' cmd_type=elb consumer=True job_name=dev:tap-mysql-to-target-postgres name=target-postgres producer=False run_id=e3d8d66d-433b-4aef-a710-36b824334e4b stdio=stderr string_id=target-postgres
It reads
8:30:00
, singer related, have any of you guys face and solve this one?
1
I got this solved by editing this file
\my-meltano-project\.meltano\loaders\target-postgres\venv\Lib\site-packages\singer_sdk\sinks\core.py
And added this code on
line 556
Copy code
date_val = '0' + date_val if len(date_val) == 7 else date_val
But I think the change should be done on the root cause, not this hack
👍 1
e
8:30:00
is indeed not a valid isoformat time by looking at https://datatracker.ietf.org/doc/html/rfc3339#section-5.6. So, in my opinion it'd be the tap job to fix that but I'm open to make the targets more resilient by handling these cases: https://github.com/meltano/sdk/issues/2591. Just curious, which variant of tap-mysql is this?
r
Just curious, which variant of tap-mysql is this?
This tap @Edgar Ramírez (Arch.dev)
Copy code
- name: tap-mysql
    variant: transferwise
    pip_url: pipelinewise-tap-mysql
So, in my opinion it'd be the tap job to fix that but I'm open to make the targets more resilient by handling these cases:
Sorry couldn't provide better solution, was in the middle of POC for next month project, so I'm currently doing quick trial for my data stack, previously trying Airbyte but I find Meltano is more controllable for me
e
I find Meltano is more controllable for me
That's nice to hear! Ok, I think I've identified the root cause in the tap: https://github.com/transferwise/pipelinewise-tap-mysql/blob/b86a4c11394535d277368583b52010cedff24dd3/tap_mysql/sync_strategies/common.py#L106 There's even a comment there, but the result is the contrary:
Copy code
>>> import datetime
>>> str(datetime.timedelta(hours=8, minutes=30))
'8:30:00'
Let's hope they merge it and not just unceremoniously close it 😅, but at least that branch in my PR should work.
r
Hopefully! 🤞
e
but at least that branch in my PR should work.
Would you like giving it a try?
Copy code
plugins:
  extractors:
  - name: tap-mysql
    pip_url: git+<https://github.com/edgarrmondragon/pipelinewise-tap-mysql.git@patch-1>
should do the trick 🙂
r
Confirmed that did the trick! @Edgar Ramírez (Arch.dev) 🔥
🙌 1