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

SQL syntax does not support composite keys #8

Closed
hgldarby opened this issue Oct 30, 2020 · 2 comments
Closed

SQL syntax does not support composite keys #8

hgldarby opened this issue Oct 30, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@hgldarby
Copy link

hgldarby commented Oct 30, 2020

From the readme

# We start with creating two tables:
left = Table()
left.add_column('number', int, allow_empty=True, data=[1, 2, 3, 4, None])
left.add_column('color', str, data=['black', 'blue', 'white', 'white', 'blue'])  # US english color.

right = Table()
right.add_column('letter', str, allow_empty=True, data=['a', 'b,', 'c', 'd', None])
right.add_column('colour', str, data=['blue', 'white', 'orange', 'white', 'blue'])  # Queens english.

# Now this wont work:
left_join = left.left_join(right, keys=['colour'], columns=['number', 'letter'])

# Because keys need to match `colour` with `color`

A possible fix could be a list containing a tuple of keys where index 0 indicates the left column and index 1 indicates the right.

@root-11 root-11 self-assigned this Nov 3, 2020
@root-11 root-11 added the bug Something isn't working label Nov 3, 2020
@root-11
Copy link
Owner

root-11 commented Nov 3, 2020

solved in 37928a4
packaged as https://pypi.org/project/tablite/2020.11.3.53696/
readme updated in 39e2def

@root-11
Copy link
Owner

root-11 commented Nov 3, 2020

@hgldarby Please review and close ticket.

@root-11 root-11 closed this as completed Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants