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

Unhandled exception from generate-table-partitions on an empty table #1306

Open
nj1973 opened this issue Oct 29, 2024 · 0 comments
Open

Unhandled exception from generate-table-partitions on an empty table #1306

nj1973 opened this issue Oct 29, 2024 · 0 comments
Labels
priority: p3 Lowest priority. This can be something deprioritized or not time sensitive. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@nj1973
Copy link
Contributor

nj1973 commented Oct 29, 2024

Test case:

SQL> create table dvt_test.tab_empty (id number(5), data varchar2(30));

$ data-validation generate-table-partitions -sc ora -tc ora -tbls dvt_test.tab_empty --primary-keys id   --hash '*'   --config-dir "/tmp/empty.yaml" --partition-num 2
Traceback (most recent call last):
...
  File "/home/xyz/professional-services-data-validator/data_validation/partition_builder.py", line 283, in _get_partition_key_filters
    first_elements[1, : len(source_pks)],
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
IndexError: index 1 is out of bounds for axis 0 with size 0

Obviously there's not much we can dio with an empty table but a better exception would make sense.

@helensilva14 helensilva14 added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p3 Lowest priority. This can be something deprioritized or not time sensitive. labels Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Lowest priority. This can be something deprioritized or not time sensitive. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants