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

Fix handle 'Progress' packet while inserting from input #326

Closed
carlosfy opened this issue Aug 4, 2022 · 0 comments · Fixed by #327
Closed

Fix handle 'Progress' packet while inserting from input #326

carlosfy opened this issue Aug 4, 2022 · 0 comments · Fixed by #327

Comments

@carlosfy
Copy link
Contributor

carlosfy commented Aug 4, 2022

Describe the bug
When inserting data into a table from input using the method Cient.execute(query, data), the data gets inserted into the table but the python code raises an exception: 'Unexpected packet from server (expected Data, Exception, Log or TableColumns, got Progress)'

To Reproduce

def test_insert_from_input(self):
        with self.create_table('a Int8'):
            data = [{'a': 1}]
            self.client.execute(
                "INSERT INTO test (a) "
                "SELECT a from input ('a Int8')",
                data
            )

            query = 'SELECT * FROM test'
            inserted = self.emit_cli(query)
            self.assertEqual(inserted, '1\n')

Expected behavior
The python code should not raise an exception when receiving a packet of type: ServerPacketTypes.PROGRESS.
It should instead keep listening for new packets until its gets something else than Progress (e.g Exception).

Versions

  • Version of the package: 0.2.0 and 0.2.4 (I have just tried with these 2)
  • Clickhouse version: 22.3.6.5 (the bug does not occur on 21.6.9.7)
  • Python version: 3.8
carlosfy pushed a commit to carlosfy/clickhouse-driver-fix that referenced this issue Aug 4, 2022
carlosfy pushed a commit to carlosfy/clickhouse-driver-fix that referenced this issue Aug 4, 2022
carlosfy added a commit to carlosfy/clickhouse-driver-fix that referenced this issue Aug 16, 2022
@carlosfy carlosfy changed the title Fix handle 'Progress' packet while inserting Fix handle 'Progress' packet while inserting from input Aug 17, 2022
xzkostyan added a commit that referenced this issue Aug 26, 2022
Fix handle Progress packet while insert from input (#326)
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 a pull request may close this issue.

1 participant