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

bit data type is casted as string and results in an error #74

Closed
BamboOSZ opened this issue Mar 28, 2024 · 1 comment
Closed

bit data type is casted as string and results in an error #74

BamboOSZ opened this issue Mar 28, 2024 · 1 comment

Comments

@BamboOSZ
Copy link
Contributor

The data source I'm using contains a couple of columns of a bit(1) type (yeah, they could have used boolean instead).
Anyway, when I run tap-mysql against it I receive the following error:

2024-03-28T16:34:30.935510Z [info     ]     raise error                cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2024-03-28T16:34:30.936500Z [info     ] jsonschema.exceptions.ValidationError: 1 is not of type 'string', 'null' cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2024-03-28T16:34:30.936500Z [info     ]                                cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2024-03-28T16:34:30.937503Z [info     ] Failed validating 'type' in schema['properties']['IsForLookup']: cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2024-03-28T16:34:30.937503Z [info     ]     {'type': ['string', 'null']} cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2024-03-28T16:34:30.937503Z [info     ]                                cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2024-03-28T16:34:30.937503Z [info     ] On instance['IsForLookup']:    cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake
2024-03-28T16:34:30.938500Z [info     ]     1                          cmd_type=elb consumer=True name=target-snowflake producer=False stdio=stderr string_id=target-snowflake

Looks like it's incorrectly mapped as string. Can this be fixed?

@visch
Copy link
Member

visch commented Mar 28, 2024

Definietly fixable, easy one is you should be able to override the schema and specify that this is an integer and you'd be good to go.

Fix would be here https://github.com/MeltanoLabs/tap-mysql/blob/main/tap_mysql/client.py#L174 need a mapping for bit. We should also take target-postgres's lead here https://github.com/MeltanoLabs/target-postgres?tab=readme-ov-file#data-types and do a mapping of data types to be sure we didn't miss anything else obvious like this!

BamboOSZ added a commit to BamboOSZ/tap-mysql that referenced this issue Apr 4, 2024
Addressing issue : bit data type is casted as string and results in an error MeltanoLabs#74
visch pushed a commit that referenced this issue Apr 5, 2024
Addressing issue : bit data type is casted as string and results in an error #74
@visch visch closed this as completed Apr 5, 2024
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

No branches or pull requests

2 participants