Commit c27028f
authored
Type mismatch Avro zstd decompression (#2128)
<!--
Thanks for opening a pull request!
-->
<!-- In the case this PR will resolve an issue, please replace
${GITHUB_ISSUE_ID} below with the actual Github issue id. -->
<!-- Closes #${GITHUB_ISSUE_ID} -->
# Rationale for this change
The return type of the decompress method in `ZStandardCodec` should be
`bytes`, but it currently returns a `bytearray`, which causes an
exception when reading Avro files compressed with zstd.
```text
def new_decoder(b: bytes) -> BinaryDecoder:
try:
from pyiceberg.avro.decoder_fast import CythonBinaryDecoder
> return CythonBinaryDecoder(b)
E TypeError: Argument 'input_contents' has incorrect type (expected bytes, got bytearray)
```
# Are these changes tested?
Yes, `test_write_manifest`
# Are there any user-facing changes?
No.
<!-- In the case of user-facing changes, please add the changelog label.
-->1 parent 1ac8ffb commit c27028f
File tree
2 files changed
+2
-2
lines changed- pyiceberg/avro/codecs
- tests/utils
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
| 361 | + | |
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
| |||
0 commit comments