Skip to content

python client: scan has wrong return typeΒ #5617

@Redoubts

Description

@Redoubts

Describe the bug

Currently scan is typed to return List[Union[bytes, List[bytes]]]. I think that's not correct, and can be vexing for clients using mypy and the like.

List[Union[bytes, List[bytes]]] is closer to -> [[b'1', b'2', b'3'], [b'1', b'2', b'3'], ...] | [b'1', b'2', b'3', ...]; where as this function is actually shaped like [b'0', [b'1', b'2', b'3', ...]].

Tuple[bytes, List[bytes] is more appropriate for communicating this shape (fixed size + heterogeneous types).

Expected Behavior

A good mypy experience with the client

Current Behavior

A less than good mypy experience with the client

Reproduction Steps

N/A

Possible Solution

No response

Additional Information/Context

No response

Client version used

2.2.7

Engine type and version

N/A

Engine Environment

N/A

OS

N/A

Language

Python

Language Version

3.12

Cluster information

No response

Logs

No response

Other information

No response

Metadata

Metadata

Assignees

Labels

Task πŸ”§Implementation work (not a bug)Users PainAn issue known to cause users pain, generaly open by the user.python 🐍Python wrapper

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions