-
Notifications
You must be signed in to change notification settings - Fork 0
fix: skip emitting multipleOf #5
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
base: master
Are you sure you want to change the base?
fix: skip emitting multipleOf #5
Conversation
For views key_properties was null, and my postgres target crashed when that happened.
fix: make sure key_properties is not null for views
…r exception Log the original exception so we know the original cause, and don't make it with another exception.
Seems unsupported since Oracle 12c.
Possibly something going wrong, but I do not understand the purpose of the test. No longer working tests are commented out.
Unclear why this test fails. Possibly because of log miner? Skip for now.
…k-again Test/make tests work again
Certain targets such as postgres type check input against the schema.
…e-as-number fix: emit number as number instead of string
Don't understand it's purpose, and I got values like 1e-38 which the postgres target json schema validator didn't like.
|
This has been included to conform with the JSONSchema keyword https://cswr.github.io/JsonSchema/spec/basic_types/ I think |
|
The error you're encountering is mentioned specifically here: datamill-co/target-postgres#207 However if you are using the transferwise variant, then this line would stop the target if |
|
Reproducing the error, basic test against JSON schema: from jsonschema import Draft4Validator, FormatChecker
import jsonschema
import json
import decimal
messages = [
{
"type": "SCHEMA",
"stream": "foobar",
"schema": {
"type": "object",
"properties": {
"sample_numeric": {
"type": ["null", "number"],
"exclusiveMaximum": True,
"maximum": 100000000000000000000000000000000000000000000000000000000000000,
"multipleOf": decimal.Decimal(10**-38),
"exclusiveMinimum": True,
"minimum": -100000000000000000000000000000000000000000000000000000000000000
}
}
}
}
,
{
"type": "RECORD",
"stream": "foobar",
"record": {
"sample_numeric": decimal.Decimal(0.000913808181253534)
}
}
]
validator = Draft4Validator(messages[0]['schema'],format_checker=FormatChecker())
validator.validate(messages[1]['record'])The error occurs if the I have no access to test this against Oracle, but I suspect a def OutputTypeHandler(cursor, name, defaultType, size, precision, scale):
if defaultType == cx_Oracle.NUMBER:
return cursor.var(decimal.Decimal, arraysize = cursor.arraysize)
if defaultType == cx_Oracle.CLOB:
return cursor.var(cx_Oracle.LONG_STRING, arraysize=cursor.arraysize)
if defaultType == cx_Oracle.NCLOB:
return cursor.var(cx_Oracle.LONG_STRING, arraysize=cursor.arraysize)
if defaultType == cx_Oracle.BLOB:
return cursor.var(cx_Oracle.LONG_BINARY, arraysize=cursor.arraysize)I don't have access to an Oracle source until Monday, but it would be good to see the contents of the |
|
@berenddeboer - I have just updated my version of singer-python (that this repo depends on) to output decimal.Decimal values as numbers as opposed to strings. This may fix your issue if you're still concerned about it. Let me know if you have a chance to retest it and update me with the results. Cheers! |
2681957 to
3c27f01
Compare
Problem
Target postgres does not like the value "1e-38" I'm seeing. For example I get this output for the type of a column:
{ "multipleOf": 1e-38, "type": [ "null", "number" ] }This crashes postgres with:
Proposed changes
Don't understand it's purpose, and I got values like 1e-38 which the postgres target json schema validator didn't like. So simply drop this code. Have left it commented out. Left the other instances in the code, but they could possibly go to.
Types of changes
What types of changes does your code introduce to PipelineWise?
Put an
xin the boxes that applyChecklist
setup.pyis an individual PR and not mixed with feature or bugfix PRs[AP-NNNN](if applicable. AP-NNNN = JIRA ID)AP-NNN(if applicable. AP-NNN = JIRA ID)