mohamedawnallah commented on PR #35473:
URL: https://github.com/apache/beam/pull/35473#issuecomment-3263935880
> @mohamedawnallah would you mind taking a look at the failures here?
>
> ```
>
apache_beam/examples/snippets/transforms/elementwise/enrichment_test.py:203: in
sql_test_context
> result = EnrichmentTestHelpers.pre_sql_enrichment_test(
>
apache_beam/examples/snippets/transforms/elementwise/enrichment_test.py:246: in
pre_sql_enrichment_test
> os.environ['GOOGLE_CLOUD_SQL_DB_PASSWORD'] = password
> /opt/hostedtoolcache/Python/3.9.22/x64/lib/python3.9/os.py:684: in
__setitem__
> value = self.encodevalue(value)
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _
>
> value = None
>
> def encode(value):
> if not isinstance(value, str):
> > raise TypeError("str expected, not %s" % type(value).__name__)
> E TypeError: str expected, not NoneType
> ```
@damccorm – The tests are currently failing because `ALLOYDB_PASSWORD` is
being perceived as `None`, even though it's configured as a secret in the
relevant workflows `PreCommit Python Coverage` and `PreCommit Python Examples`
(https://github.com/apache/beam/pull/36061).
I've encountered this exact issue before and couldn't really figure it out
(similar problem when tried to access on beam PostCommit Python workflow in
https://github.com/apache/beam/pull/34398#discussion_r2279981586). This secret
specifically seems having issues when attempting to use in other workflows.
The failure occurs at this specific line where the code attempts to read the
password environment variable:
```python
password = os.getenv("ALLOYDB_PASSWORD")
```
https://github.com/mohamedawnallah/beam/blob/af8e4fe198b89a0abfd9a88fb2c1ab0303338772/sdks/python/apache_beam/examples/snippets/transforms/elementwise/enrichment_test.py#L242
When the environment variable doesn't exist, `os.getenv()` returns `None`,
causing the test to fail.
This appears to be an infrastructure issue related to how the
`ALLOYDB_PASSWORD` secret is accessed across different
workflows. Perhaps @Amar3tto, @A1K28 can help
What do you think, @damccorm?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]