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

Apply projection expression failure cases #34

Closed
wants to merge 1 commit into from

Conversation

savan-chovatiya
Copy link

Description of change

This PR highlights an edge-case scenarios while applying project expression for a log-based streams.

Manual QA steps

Risks

Rollback steps

  • revert this branch

@savan-chovatiya
Copy link
Author

savan-chovatiya commented Nov 2, 2021

(tap-dynamodb-savan) [root@centos7 tap-dynamodb]# nosetests tests/unittests/
EEE
======================================================================
ERROR: Example Projection: Artist,metadata[0]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/savan/dynamodb/failure/tap-dynamodb/tests/unittests/test_project_expression.py", line 17, in test_project_expression1
    output = deserializer.apply_projection(mock_record, mock_projections)
  File "/home/savan/dynamodb/failure/tap-dynamodb/tap_dynamodb/deserialize.py", line 69, in apply_projection
    self._apply_projection(record, breadcrumb, output)
  File "/home/savan/dynamodb/failure/tap-dynamodb/tap_dynamodb/deserialize.py", line 49, in _apply_projection
    output[breadcrumb_key] = [record[breadcrumb_key][index]]
KeyError: 'metadata'

======================================================================
ERROR: Example Projection: Artist,metadata[0],metadata[1]
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/savan/dynamodb/failure/tap-dynamodb/tests/unittests/test_project_expression.py", line 29, in test_project_expression2
    output = deserializer.apply_projection(mock_record, mock_projections)
  File "/home/savan/dynamodb/failure/tap-dynamodb/tap_dynamodb/deserialize.py", line 69, in apply_projection
    self._apply_projection(record, breadcrumb, output)
  File "/home/savan/dynamodb/failure/tap-dynamodb/tap_dynamodb/deserialize.py", line 47, in _apply_projection
    output[breadcrumb_key].append(record[breadcrumb_key][index])
IndexError: list index out of range

======================================================================
ERROR: Example Projection: Artist,metadata[0].Age
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/savan/dynamodb/failure/tap-dynamodb/tests/unittests/test_project_expression.py", line 41, in test_project_expression3
    output = deserializer.apply_projection(mock_record, mock_projections)
  File "/home/savan/dynamodb/failure/tap-dynamodb/tap_dynamodb/deserialize.py", line 69, in apply_projection
    self._apply_projection(record, breadcrumb, output)
  File "/home/savan/dynamodb/failure/tap-dynamodb/tap_dynamodb/deserialize.py", line 59, in _apply_projection
    self._apply_projection(record[breadcrumb_key][index], breadcrumb[1:], output[breadcrumb_key][0])
KeyError: 'metadata'

----------------------------------------------------------------------
Ran 3 tests in 0.384s

FAILED (errors=3)

@karanpanchal-crest
Copy link

Covered as part of PR #35

@luandy64 luandy64 deleted the projection-expression-failure branch July 18, 2023 16:04
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

Successfully merging this pull request may close these issues.

None yet

2 participants