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

MapColumn can't nested types that have a comma. #60

Closed
Yibo-Chen13 opened this issue Nov 26, 2024 · 0 comments · Fixed by #61
Closed

MapColumn can't nested types that have a comma. #60

Yibo-Chen13 opened this issue Nov 26, 2024 · 0 comments · Fixed by #61
Assignees
Labels
bug Something isn't working

Comments

@Yibo-Chen13
Copy link
Contributor

Describe the bug
MapColumn can't nested types that have a comma.like: map(int,Decimal(9,2))map(int,map(int,int)).

def test_nested_map(self):
    with self.create_stream('a map(string, map(int,int))'):
        data = [
            ({},),
            ({'key1': {1: 2}}, ),
            ({'key1': {2: 1}, 'key2': {1: 2}}, ),
            ({'key1': {2: 1}, 'key2': {2: 1}, 'key3': {2: 1}}, )
        ]
        self.client.execute('INSERT INTO test (a) VALUES', data)
        query = 'SELECT * FROM test'
        inserted = self.emit_cli(query)
        self.assertEqual(
            self._sorted_dicts(inserted),
            "{}\n"
            "{'key1':{1:2}}\n"
            "{'key1':{2:1},'key2':{1:2}}\n"
            "{'key1':{2:1},'key2':{2:1},'key3':{2:1}}\n"
        )
        inserted = self.client.execute(query)
        self.assertEqual(inserted, data)

Expected behavior
Expected no error.But:

./tests/columns/test_map.py::MapTestCase::test_nested_map Failed: [undefined]ValueError: too many values to unpack (expected 2)

Versions

package:v0.2.11
Proton server:2.5.1

@Yibo-Chen13 Yibo-Chen13 self-assigned this Nov 26, 2024
@Yibo-Chen13 Yibo-Chen13 linked a pull request Nov 26, 2024 that will close this issue
@Yibo-Chen13 Yibo-Chen13 added the bug Something isn't working label Dec 2, 2024
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

Successfully merging a pull request may close this issue.

1 participant