feat: add bigframes.bigquery.deterministic_decrypt* and bigframes.bigquery.deterministic_encrypt functions#17212
feat: add bigframes.bigquery.deterministic_decrypt* and bigframes.bigquery.deterministic_encrypt functions#17212tswast wants to merge 2 commits into
bigframes.bigquery.deterministic_decrypt* and bigframes.bigquery.deterministic_encrypt functions#17212Conversation
…bigquery.deterministic_encrypt` functions
There was a problem hiding this comment.
Code Review
This pull request introduces deterministic encryption operations (encrypt, decrypt_bytes, and decrypt_string) to the BigQuery operations module. The changes include updates to the global namespace, a new configuration file, and corresponding unit tests. Review feedback points out several PEP 8 line length violations in type hints and identifies unused imports in the newly generated aead_encryption.py file, suggesting improvements to the generator script.
I am having trouble creating individual review comments. Click here to see my feedback.
packages/bigframes/bigframes/bigquery/_operations/aead.py (53-55)
The manual flattening of these type hints into single lines violates PEP 8 line length limits (79 characters) and degrades readability. Additionally, the nested Union is redundant. Reverting to a multi-line format with a simplified Union is recommended.
keyset: Union[
T,
bigframes.core.col.Expression,
Literal[sentinels.Sentinel.ARGUMENT_DEFAULT],
bytes,
dict,
],
ciphertext: Union[
T,
bigframes.core.col.Expression,
Literal[sentinels.Sentinel.ARGUMENT_DEFAULT],
bytes,
],
additional_data: Union[
T,
bigframes.core.col.Expression,
Literal[sentinels.Sentinel.ARGUMENT_DEFAULT],
bytes,
],References
- PEP 8 recommends a line length limit of 79 characters for Python code. (link)
packages/bigframes/bigframes/bigquery/_operations/aead.py (67-69)
The manual flattening of these type hints into single lines violates PEP 8 line length limits (79 characters) and degrades readability. Additionally, the nested Union is redundant. Reverting to a multi-line format with a simplified Union is recommended.
keyset: Union[
T,
bigframes.core.col.Expression,
Literal[sentinels.Sentinel.ARGUMENT_DEFAULT],
bytes,
dict,
],
ciphertext: Union[
T,
bigframes.core.col.Expression,
Literal[sentinels.Sentinel.ARGUMENT_DEFAULT],
bytes,
],
additional_data: Union[
T,
bigframes.core.col.Expression,
Literal[sentinels.Sentinel.ARGUMENT_DEFAULT],
str,
],References
- PEP 8 recommends a line length limit of 79 characters for Python code. (link)
packages/bigframes/bigframes/bigquery/_operations/aead.py (81-83)
The manual flattening of these type hints into single lines violates PEP 8 line length limits (79 characters) and degrades readability. Additionally, the nested Union is redundant. Reverting to a multi-line format with a simplified Union is recommended.
keyset: Union[
T,
bigframes.core.col.Expression,
Literal[sentinels.Sentinel.ARGUMENT_DEFAULT],
bytes,
dict,
],
plaintext: Union[
T,
bigframes.core.col.Expression,
Literal[sentinels.Sentinel.ARGUMENT_DEFAULT],
bytes,
str,
],
additional_data: Union[
T,
bigframes.core.col.Expression,
Literal[sentinels.Sentinel.ARGUMENT_DEFAULT],
bytes,
str,
],References
- PEP 8 recommends a line length limit of 79 characters for Python code. (link)
packages/bigframes/bigframes/bigquery/_operations/global_namespace/aead_encryption.py (21-31)
This generated file contains several unused imports: datetime, Any, Optional, bigframes.core.expression as ex, and bigframes.operations as ops. Please update the generator script scripts/generate_bigframes_bigquery.py to only include necessary imports.
from typing import Literal, TypeVar, Union
import bigframes.bigquery._googlesql
import bigframes.core.col
import bigframes.core.sentinels as sentinels
import bigframes.series as series
from bigframes import dtypes
from bigframes.operations import googlesql
References
- Unused imports should be removed to maintain code cleanliness. (link)
packages/bigframes/bigframes/bigquery/_operations/global_namespace/aead_encryption.py (53-55)
The generated type hints exceed the PEP 8 line length limit of 79 characters. Please update the generator script scripts/generate_bigframes_bigquery.py to produce multi-line type hints and simplify redundant nested Union structures.
keyset: Union[
T,
bigframes.core.col.Expression,
Literal[sentinels.Sentinel.ARGUMENT_DEFAULT],
bytes,
dict,
],
ciphertext: Union[
T,
bigframes.core.col.Expression,
Literal[sentinels.Sentinel.ARGUMENT_DEFAULT],
bytes,
],
additional_data: Union[
T,
bigframes.core.col.Expression,
Literal[sentinels.Sentinel.ARGUMENT_DEFAULT],
bytes,
],References
- PEP 8 recommends a line length limit of 79 characters for Python code. (link)
🦕