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

Bug in get_connection #26

Open
Izayda opened this issue Jun 4, 2015 · 0 comments
Open

Bug in get_connection #26

Izayda opened this issue Jun 4, 2015 · 0 comments

Comments

@Izayda
Copy link

Izayda commented Jun 4, 2015

If in odbc_kwargs key 'servername' is passed, error "TypeError: get_connection() got multiple values for keyword argument 'servername'" occurs.

it occurs here:

   connection = pyodbc.connect(**kwargs)

    if reconnect:
        return get_connection(
            reconnect=False,
            servername=_get_random_node_address(connection),
            **kwargs
        )

Test example:

def a(bool_clause=True,**kwargs):
    x=kwargs
    if bool_clause:
       x=a(bool_clause=False,servername='good string',**kwargs)
    return x


print a(a=True,**{'servername':'bad string','Database':'testDB'})

There are different ways of fixing it, so i didn't create a pull request.

Thanks for a pyvertica, it's great!)

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

No branches or pull requests

1 participant