Hey all, Could someone help me understand how to c...
# troubleshoot
f
Hey all, Could someone help me understand how to come around solving https://github.com/datahub-project/datahub/issues/5295 For Vertica source in case of timestamp(x) or timestamptz(x), the following warning is raised:
'warnings': {'XSCHEMA.YTABLE': ['unable to get column information due to an error -> __init__() got an unexpected keyword ' "argument 'precision'"]}
This issue is raised from the following code in source\sql\vertica.py:
Copy code
elif attype in ("timestamptz", "timetz"):
        kwargs["timezone"] = True
        if charlen:
            kwargs["precision"] = int(charlen)  # type: ignore
        args = ()  # type: ignore
    elif attype in ("timestamp", "time"):
        kwargs["timezone"] = False
        if charlen:
            kwargs["precision"] = int(charlen)  # type: ignore
Which leads to the point that TIMESTAMP imported from
sqlalchemy.sql.sqltypes import TIME, TIMESTAMP, String
is missing the parameter precision: https://docs.sqlalchemy.org/en/14/core/type_basics.html#sqlalchemy.types.DateTime One of the solutions would be to add
Copy code
self.precision = precision
into the
Copy code
class TIMESTAMP(DateTime):
in \Lib\site-packages\sqlalchemy\sql\sqltypes.py Which results in the correct output
Copy code
{
  "fieldPath": "DATE_CREATED",
  "jsonPath": null,
  "nullable": true,
  "description": null,
  "created": null,
  "lastModified": null,
  "type": {
    "type": {
      "com.linkedin.pegasus2avro.schema.TimeType": {}
    }
  },
  "nativeDataType": "TIMESTAMP(precision=0)",
  "recursive": false,
  "globalTags": null,
  "glossaryTerms": null,
  "isPartOfKey": false,
  "isPartitioningKey": null,
  "jsonProps": null
}
Since the fix is in sqlalchemy files, how to implement this to datahub code instead?
d
Give me some time to check it myself what options we have
f
@dazzling-judge-80093, any luck or ideas regarding this 🙂?
Hey, just a follow-up, have you had any progress regarding this? We're currently patching it in our docker container, but as mentioned the patch changes code in sqlaclhemy dependency code