Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .librarian/state.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-li
libraries:
- id: google-cloud-bigtable
version: 2.35.0
last_generated_commit: a17b84add8318f780fcc8a027815d5fee644b9f7
last_generated_commit: 9637e50bc0ff6a5e8944980aaf6a2b7f34a90910
apis:
- path: google/bigtable/v2
service_config: bigtable_v2.yaml
Expand Down
4 changes: 4 additions & 0 deletions google/cloud/bigtable_admin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@
from google.cloud.bigtable_admin_v2.types.table import SchemaBundle
from google.cloud.bigtable_admin_v2.types.table import Snapshot
from google.cloud.bigtable_admin_v2.types.table import Table
from google.cloud.bigtable_admin_v2.types.table import TieredStorageConfig
from google.cloud.bigtable_admin_v2.types.table import TieredStorageRule
from google.cloud.bigtable_admin_v2.types.table import RestoreSourceType
Comment on lines 316 to 321
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better maintainability and adherence to PEP 8, the imports from google.cloud.bigtable_admin_v2.types.table should be sorted alphabetically.

Suggested change
from google.cloud.bigtable_admin_v2.types.table import SchemaBundle
from google.cloud.bigtable_admin_v2.types.table import Snapshot
from google.cloud.bigtable_admin_v2.types.table import Table
from google.cloud.bigtable_admin_v2.types.table import TieredStorageConfig
from google.cloud.bigtable_admin_v2.types.table import TieredStorageRule
from google.cloud.bigtable_admin_v2.types.table import RestoreSourceType
from google.cloud.bigtable_admin_v2.types.table import RestoreSourceType
from google.cloud.bigtable_admin_v2.types.table import SchemaBundle
from google.cloud.bigtable_admin_v2.types.table import Snapshot
from google.cloud.bigtable_admin_v2.types.table import Table
from google.cloud.bigtable_admin_v2.types.table import TieredStorageConfig
from google.cloud.bigtable_admin_v2.types.table import TieredStorageRule
References
  1. PEP 8, the style guide for Python code, recommends that imports should be sorted alphabetically. (link)

from google.cloud.bigtable_admin_v2.types.types import Type

Expand Down Expand Up @@ -441,6 +443,8 @@
"SchemaBundle",
"Snapshot",
"Table",
"TieredStorageConfig",
"TieredStorageRule",
"RestoreSourceType",
"Type",
Comment on lines 443 to 449
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve readability and follow common Python conventions, the contents of __all__ should be sorted alphabetically.

Suggested change
"SchemaBundle",
"Snapshot",
"Table",
"TieredStorageConfig",
"TieredStorageRule",
"RestoreSourceType",
"Type",
"RestoreSourceType",
"SchemaBundle",
"Snapshot",
"Table",
"TieredStorageConfig",
"TieredStorageRule",
"Type",
References
  1. PEP 8, the style guide for Python code, recommends that entries in __all__ should be sorted alphabetically. (link)

)
Expand Down
4 changes: 4 additions & 0 deletions google/cloud/bigtable_admin_v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@
from .types.table import SchemaBundle
from .types.table import Snapshot
from .types.table import Table
from .types.table import TieredStorageConfig
from .types.table import TieredStorageRule
from .types.table import RestoreSourceType
Comment on lines 150 to 155
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better maintainability and adherence to PEP 8, the imports from .types.table should be sorted alphabetically.

Suggested change
from .types.table import SchemaBundle
from .types.table import Snapshot
from .types.table import Table
from .types.table import TieredStorageConfig
from .types.table import TieredStorageRule
from .types.table import RestoreSourceType
from .types.table import RestoreSourceType
from .types.table import SchemaBundle
from .types.table import Snapshot
from .types.table import Table
from .types.table import TieredStorageConfig
from .types.table import TieredStorageRule
References
  1. PEP 8, the style guide for Python code, recommends that imports should be sorted alphabetically. (link)

from .types.types import Type

Expand Down Expand Up @@ -353,6 +355,8 @@ def _get_version(dependency_name):
"StandardReadRemoteWrites",
"StorageType",
"Table",
"TieredStorageConfig",
"TieredStorageRule",
"Type",
"UndeleteTableMetadata",
"UndeleteTableRequest",
Expand Down
4 changes: 4 additions & 0 deletions google/cloud/bigtable_admin_v2/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@
SchemaBundle,
Snapshot,
Table,
TieredStorageConfig,
TieredStorageRule,
RestoreSourceType,
Comment on lines 139 to 144
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve readability and follow common Python conventions, the imported names from .table should be sorted alphabetically.

Suggested change
SchemaBundle,
Snapshot,
Table,
TieredStorageConfig,
TieredStorageRule,
RestoreSourceType,
RestoreSourceType,
SchemaBundle,
Snapshot,
Table,
TieredStorageConfig,
TieredStorageRule,
References
  1. PEP 8, the style guide for Python code, recommends that imports should be sorted alphabetically. (link)

)
from .types import (
Expand Down Expand Up @@ -263,6 +265,8 @@
"SchemaBundle",
"Snapshot",
"Table",
"TieredStorageConfig",
"TieredStorageRule",
"RestoreSourceType",
"Type",
Comment on lines 265 to 271
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve readability and follow common Python conventions, the contents of __all__ should be sorted alphabetically.

Suggested change
"SchemaBundle",
"Snapshot",
"Table",
"TieredStorageConfig",
"TieredStorageRule",
"RestoreSourceType",
"Type",
"RestoreSourceType",
"SchemaBundle",
"Snapshot",
"Table",
"TieredStorageConfig",
"TieredStorageRule",
"Type",
References
  1. PEP 8, the style guide for Python code, recommends that entries in __all__ should be sorted alphabetically. (link)

)
62 changes: 62 additions & 0 deletions google/cloud/bigtable_admin_v2/types/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
"Snapshot",
"Backup",
"BackupInfo",
"TieredStorageConfig",
"TieredStorageRule",
"ProtoSchema",
"SchemaBundle",
},
Expand Down Expand Up @@ -166,6 +168,17 @@ class Table(proto.Message):
disabled.

This field is a member of `oneof`_ ``automated_backup_config``.
tiered_storage_config (google.cloud.bigtable_admin_v2.types.TieredStorageConfig):
Rules to specify what data is stored in each
storage tier. Different tiers store data
differently, providing different trade-offs
between cost and performance. Different parts of
a table can be stored separately on different
tiers.
If a config is specified, tiered storage is
enabled for this table. Otherwise, tiered
storage is disabled.
Only SSD instances can configure tiered storage.
row_key_schema (google.cloud.bigtable_admin_v2.types.Type.Struct):
The row key schema for this table. The schema is used to
decode the raw row key bytes into a structured format. The
Expand Down Expand Up @@ -399,6 +412,11 @@ class AutomatedBackupPolicy(proto.Message):
oneof="automated_backup_config",
message=AutomatedBackupPolicy,
)
tiered_storage_config: "TieredStorageConfig" = proto.Field(
proto.MESSAGE,
number=14,
message="TieredStorageConfig",
)
row_key_schema: types.Type.Struct = proto.Field(
proto.MESSAGE,
number=15,
Expand Down Expand Up @@ -1028,6 +1046,50 @@ class BackupInfo(proto.Message):
)


class TieredStorageConfig(proto.Message):
r"""Config for tiered storage.
A valid config must have a valid TieredStorageRule. Otherwise
the whole TieredStorageConfig must be unset.
By default all data is stored in the SSD tier (only SSD
instances can configure tiered storage).

Attributes:
infrequent_access (google.cloud.bigtable_admin_v2.types.TieredStorageRule):
Rule to specify what data is stored in the
infrequent access(IA) tier. The IA tier allows
storing more data per node with reduced
performance.
"""

infrequent_access: "TieredStorageRule" = proto.Field(
proto.MESSAGE,
number=1,
message="TieredStorageRule",
)


class TieredStorageRule(proto.Message):
r"""Rule to specify what data is stored in a storage tier.

.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

Attributes:
include_if_older_than (google.protobuf.duration_pb2.Duration):
Include cells older than the given age.
For the infrequent access tier, this value must
be at least 30 days.

This field is a member of `oneof`_ ``rule``.
"""

include_if_older_than: duration_pb2.Duration = proto.Field(
proto.MESSAGE,
number=1,
oneof="rule",
message=duration_pb2.Duration,
)


class ProtoSchema(proto.Message):
r"""Represents a protobuf schema.

Expand Down
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
UNIT_TEST_EXTRAS: List[str] = []
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}

SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.10", "3.14"]
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.9", "3.14"]
SYSTEM_TEST_STANDARD_DEPENDENCIES: List[str] = [
"mock",
"pytest",
Expand All @@ -83,6 +83,7 @@

# 'docfx' is excluded since it only needs to run in 'docs-presubmit'
nox.options.sessions = [
"unit-3.9",
"unit-3.10",
"unit-3.11",
"unit-3.12",
Expand Down Expand Up @@ -516,7 +517,6 @@ def prerelease_deps(session, protobuf_implementation):
# Remaining dependencies
other_deps = [
"requests",
"cryptography",
]
session.install(*other_deps)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23509,6 +23509,7 @@ def test_update_table_rest_call_success(request_type):
"change_stream_config": {"retention_period": {"seconds": 751, "nanos": 543}},
"deletion_protection": True,
"automated_backup_policy": {"retention_period": {}, "frequency": {}},
"tiered_storage_config": {"infrequent_access": {"include_if_older_than": {}}},
"row_key_schema": {
"fields": [
{
Expand Down
Loading