Open
Conversation
- When `through_tables` are explicitly specified, the table gets added to the tree when it shouldn't.
toluaina
reviewed
Sep 2, 2022
pgsync/node.py
Outdated
| ) | ||
|
|
||
| self.tables.add(node.table) | ||
| for through_node in node.relationship.through_nodes: |
Owner
There was a problem hiding this comment.
I believe this will break a test case.
Can you please try the main branch again and see if this issue was fixed?
Contributor
There was a problem hiding this comment.
@toluaina can you elaborate on your fix or point to the commit that fixed it? I did try this and it fixed this exact same issue for me and I'll like to contribute if possible, your main branch is getting a different error if I try it:
2022-10-17 22:15:57.859:ERROR:pgsync.elastichelper: Exception list index out of range
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pgsync/elastichelper.py", line 140, in bulk
raise_on_error=raise_on_error,
File "/usr/local/lib/python3.7/site-packages/pgsync/elastichelper.py", line 195, in _bulk
ignore_status=ignore_status,
File "/usr/local/lib/python3.7/site-packages/elasticsearch/helpers/actions.py", line 484, in parallel_bulk
actions, chunk_size, max_chunk_bytes, client.transport.serializer
File "/usr/local/lib/python3.7/multiprocessing/pool.py", line 748, in next
raise value
File "/usr/local/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/usr/local/lib/python3.7/multiprocessing/pool.py", line 140, in _helper_reraises_exception
raise ex
File "/usr/local/lib/python3.7/multiprocessing/pool.py", line 292, in _guarded_task_generation
for i, x in enumerate(iterable):
File "/usr/local/lib/python3.7/site-packages/elasticsearch/helpers/actions.py", line 155, in _chunk_actions
for action, data in actions:
File "/usr/local/lib/python3.7/site-packages/pgsync/sync.py", line 809, in _payloads
payloads,
File "/usr/local/lib/python3.7/site-packages/pgsync/sync.py", line 482, in _insert_op
if key == foreign_keys[node.parent.name][i]:
IndexError: list index out of range
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
through_tablesare explicitly specified, the table gets added to the tree when it shouldn't.