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

Teradata validations: Error when validating NUMBER or DECIMAL with no precision/scale #913

Closed
nehanene15 opened this issue Jul 25, 2023 · 0 comments · Fixed by #914
Closed
Assignees
Labels
priority: p0 Highest priority. Critical issue. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@nehanene15
Copy link
Collaborator

When validating Teradata tables with schema NUMBER or DECIMAL with no precision or scale, DVT throws the following error:

File "/home/user/professional-services-data-validator/env/lib/python3.10/site-packages/third_party/ibis/ibis_teradata/datatypes.py", line 58, in to_ibis
    return getattr(cls, to_ibis_func_name)(col_data, return_ibis_type=True)
  File "/home/user/professional-services-data-validator/env/lib/python3.10/site-packages/third_party/ibis/ibis_teradata/datatypes.py", line 79, in to_ibis_from_N
    return cls.to_ibis_from_D(col_data, return_ibis_type=return_ibis_type)
  File "/home/user/professional-services-data-validator/env/lib/python3.10/site-packages/third_party/ibis/ibis_teradata/datatypes.py", line 99, in to_ibis_from_D
    return dt.Decimal(precision, scale)
  File "/home/user/professional-services-data-validator/env/lib/python3.10/site-packages/ibis/common/grounds.py", line 25, in __call__
    return cls.__create__(*args, **kwargs)
  File "/home/user/professional-services-data-validator/env/lib/python3.10/site-packages/ibis/common/grounds.py", line 99, in __create__
    return super().__create__(**kwargs)
  File "/home/user/professional-services-data-validator/env/lib/python3.10/site-packages/ibis/common/grounds.py", line 33, in __create__
    return type.__call__(cls, *args, **kwargs)
  File "/home/user/professional-services-data-validator/env/lib/python3.10/site-packages/ibis/expr/datatypes/core.py", line 588, in __init__
    raise ValueError('Decimal type precision cannot be negative')
ValueError: Decimal type precision cannot be negative

This happens on tables and views. The HELP COLUMN {qualified_name}.*; command used to determine table or view schema lists a precision and scale of -128 for the NUMBER data type, which throws this ValueError.

@nehanene15 nehanene15 added priority: p0 Highest priority. Critical issue. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jul 25, 2023
@nehanene15 nehanene15 self-assigned this Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p0 Highest priority. Critical issue. Will be fixed prior to next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
1 participant