You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "sarutak (via GitHub)" <gi...@apache.org> on 2023/08/15 21:35:57 UTC
[GitHub] [avro] sarutak opened a new pull request, #2444: AVRO-3832: [Python] Make Python test works with Docker
sarutak opened a new pull request, #2444:
URL: https://github.com/apache/avro/pull/2444
AVRO-3832
## What is the purpose of the change
This PR fixes an issue that Python test doesn't work successfully with `./build.sh docker-test` due to some reasons.
Reason1:
```
/bin/sh: 1: BUILDARCH: parameter not set or nul
```
Reason2:
```
py37: install_package> python -I -m pip install --force-reinstall --no-deps /avro/lang/py/.tox/.tmp/package/258/avro-1.12.0+snapshot.tar.gz
py37: exit 1 (0.27 seconds) /avro/lang/py> python -I -m pip install --force-reinstall --no-deps /avro/lang/py/.tox/.tmp/package/258/avro-1.12.0+snapshot.tar.gz pid=243
py37: FAIL ✖ in 0.34 seconds
```
Reason3:
```
py311: install_deps> python -I -m pip install coverage python-snappy zstandard
Collecting coverage
Obtaining dependency information for coverage from https://files.pythonhosted.org/packages/55/63/f2dcc8f7f1587ae54bf8cc1c3b08e07e442633a953537dfaf658a0cbac2c/coverage-7.3.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
Downloading coverage-7.3.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (8.1 kB)
Collecting python-snappy
Downloading python-snappy-0.6.1.tar.gz (24 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting zstandard
Downloading zstandard-0.21.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.7 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.7/2.7 MB 9.4 MB/s eta 0:00:00
Downloading coverage-7.3.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (232 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 232.9/232.9 kB 12.0 MB/s eta 0:00:00
Building wheels for collected packages: python-snappy
Building wheel for python-snappy (setup.py): started
Building wheel for python-snappy (setup.py): finished with status 'error'
Running setup.py clean for python-snappy
Failed to build python-snappy
py311: exit 1 (2.64 seconds) /avro/lang/py> python -I -m pip install coverage python-snappy zstandard pid=3179
py311: FAIL ✖ in 2.94 seconds
```
Reason4:
```
pypy3.9: commands_pre[2]> coverage run -pm avro.test.gen_interop_data avro/interop.avsc avro/test/interop/data/py.avro
pypy3.9: commands_pre[3]> cp -r avro/test/interop/data /avro/lang/py/../../build/interop
pypy3.9: commands[0]> coverage run -pm unittest discover --buffer --failfast
/avro/lang/py/avro/schema.py:1233: IgnoredLogicalType: Unknown unknown-logical-type, using string.
warnings.warn(avro.errors.IgnoredLogicalType(f"Unknown {logical_type}, using {type_}."))
/avro/lang/py/avro/schema.py:1229: IgnoredLogicalType: Logical type timestamp-millis requires literal type long, not string.
warnings.warn(
/avro/lang/py/avro/schema.py:1233: IgnoredLogicalType: Unknown unknown-logical-type, using string.
warnings.warn(avro.errors.IgnoredLogicalType(f"Unknown {logical_type}, using {type_}."))
/avro/lang/py/avro/schema.py:1229: IgnoredLogicalType: Logical type timestamp-millis requires literal type long, not string.
warnings.warn(
..............F
======================================================================
FAIL: test_interop (avro.test.test_datafile_interop.TestDataFileInterop)
Test Interop
----------------------------------------------------------------------
Traceback (most recent call last):
File "/avro/lang/py/avro/test/test_datafile_interop.py", line 38, in test_interop
self.assertGreater(os.stat(filename).st_size, 0)
AssertionError: 0 not greater than 0
```
## Verifying this change
Confirmed Python test passed with `./build.sh docker-test`
## Documentation
No new features added.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [avro] kojiromike commented on a diff in pull request #2444: AVRO-3832: [Python] Make Python test work with Docker
Posted by "kojiromike (via GitHub)" <gi...@apache.org>.
kojiromike commented on code in PR #2444:
URL: https://github.com/apache/avro/pull/2444#discussion_r1296590217
##########
lang/py/avro/test/gen_interop_data.py:
##########
@@ -73,6 +73,7 @@ def generate(schema_file: TextIO, output_path: IO) -> None:
continue
base, ext = os.path.splitext(output_path.name)
Path(f"{base}_{codec}{ext}").write_bytes(data)
+ output_path.close()
Review Comment:
This should probably be in `finally` or `with closing()`
https://docs.python.org/3/library/contextlib.html#contextlib.closing
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [avro] kojiromike merged pull request #2444: AVRO-3832: [Python] Make Python test work with Docker
Posted by "kojiromike (via GitHub)" <gi...@apache.org>.
kojiromike merged PR #2444:
URL: https://github.com/apache/avro/pull/2444
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [avro] kojiromike commented on pull request #2444: AVRO-3832: [Python] Make Python test work with Docker
Posted by "kojiromike (via GitHub)" <gi...@apache.org>.
kojiromike commented on PR #2444:
URL: https://github.com/apache/avro/pull/2444#issuecomment-1681489507
Thanks for doing this work. If you are happy making the slight change I mentioned then I think this looks pretty good.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [avro] sarutak commented on a diff in pull request #2444: AVRO-3832: [Python] Make Python test work with Docker
Posted by "sarutak (via GitHub)" <gi...@apache.org>.
sarutak commented on code in PR #2444:
URL: https://github.com/apache/avro/pull/2444#discussion_r1296602811
##########
lang/py/avro/test/gen_interop_data.py:
##########
@@ -73,6 +73,7 @@ def generate(schema_file: TextIO, output_path: IO) -> None:
continue
base, ext = os.path.splitext(output_path.name)
Path(f"{base}_{codec}{ext}").write_bytes(data)
+ output_path.close()
Review Comment:
Oh, sorry. I've fixed it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org