Skip to content

Conversation

kovaacs
Copy link

@kovaacs kovaacs commented Jan 10, 2025

The type annotation is wrong here, it is expected to be a tuple

@erezsh
Copy link
Owner

erezsh commented Jan 10, 2025

Thanks! You're right, but I believe that the fix should be in line 146

    if isinstance(key_columns, str):
        key_columns = (key_columns,)
    else:
        key_columns = tuple(key_columns)

(str is a valid input too)

@kovaacs
Copy link
Author

kovaacs commented Jan 10, 2025

Right, I missed that. Changed to allow string as well.

@kovaacs
Copy link
Author

kovaacs commented Jan 10, 2025

Ah, sorry, I missed your point. I guess any iterable of strings OR string should be accepted, then the code you copied will convert it to a tuple.

@erezsh
Copy link
Owner

erezsh commented Jan 10, 2025 via email

@kovaacs
Copy link
Author

kovaacs commented Jan 10, 2025

I also adjusted connect_to_table() to match the behaviour of diff_tables()

@erezsh
Copy link
Owner

erezsh commented Jan 10, 2025

Sorry, my code should have been key_columns = tuple(key_columns or ()) or similar

@kovaacs
Copy link
Author

kovaacs commented Jan 10, 2025

I also missed that key_columns is optional, maybe I should also make that clearer with the annotation

@erezsh
Copy link
Owner

erezsh commented Jan 10, 2025

Ok, I think None has a special meaning, and converting None to () messes it up down the line.

Sorry, it's been a while since I worked on this code, so I forgot the nuances.

If you prefer, I can try to finish the PR myself. But you're of course welcome to do it yourself.

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.

2 participants