python-pinot-dbapi / pinot-dbapi

Python DB-API and SQLAlchemy dialect for Pinot
MIT License
19 stars 33 forks source link

Split extra header on first "=" #83

Closed yomikaze closed 9 months ago

yomikaze commented 10 months ago

The extra header key value pairs should be split on the first "=" to allow for values containing "=" characters.

This code on line 333:

k, v = header.split("=")

should be:

k, v = header.split("=", 1)

Otherwise there is an error:

>>> curs = conn.cursor()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.11/site-packages/pinotdb/db.py", line 57, in g
    return f(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pinotdb/db.py", line 185, in cursor
    cursor = Cursor(*self._args, **self._kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pinotdb/db.py", line 333, in __init__
    k, v = header.split("=")
    ^^^^
ValueError: too many values to unpack (expected 2)
xiangfu0 commented 9 months ago

Close this since it's fixed in #84