Skip to content

Conversation

@vitaliili
Copy link
Contributor

As part of a query, load job, or create table request, you can specify the encryption configuration, which just consists of a single string field containing the KMS key to use.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 6, 2018
@theacodes theacodes requested a review from tswast February 6, 2018 22:53

@property
def kms_key_name(self):
"""See

This comment was marked as spam.

This comment was marked as spam.

if config.skip_leading_rows is None:
del config.skip_leading_rows
if 'destinationEncryptionConfiguration' in resource:
key = resource['destinationEncryptionConfiguration']['kmsKeyName']

This comment was marked as spam.

This comment was marked as spam.

@kms_key_name.setter
def kms_key_name(self, value):
if not isinstance(value, six.string_types) and value is not None:
raise ValueError("Pass a string, or None")

This comment was marked as spam.

This comment was marked as spam.


@property
def kms_key_name(self):
"""See

This comment was marked as spam.

This comment was marked as spam.

config = cls()
config._properties = copy.deepcopy(resource)
if 'destinationEncryptionConfiguration' in resource:
key = resource['destinationEncryptionConfiguration']['kmsKeyName']

This comment was marked as spam.

This comment was marked as spam.

config._properties[prop] = from_resource(nested_resource)

if 'destinationEncryptionConfiguration' in resource:
key = resource['destinationEncryptionConfiguration']['kmsKeyName']

This comment was marked as spam.

This comment was marked as spam.

table = cls(dataset_ref.table(table_id))
table._set_properties(resource)
if 'encryptionConfiguration' in resource:
key = resource['encryptionConfiguration']['kmsKeyName']

This comment was marked as spam.

This comment was marked as spam.

klass = self._get_target_class()
job = klass.from_api_repr(RESOURCE, client=client)
self.assertIs(job._client, client)
self._verifyResourceProperties(job, RESOURCE)

This comment was marked as spam.

This comment was marked as spam.

@tswast
Copy link
Contributor

tswast commented Feb 7, 2018

@vitaliili the documentation build is failing. There's some info in https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/CONTRIBUTING.rst to get your dev environment set up.

The way to build the docs locally is to run nox -s docs from the root directory of the repo.

config.skip_leading_rows = _int_or_none(slr)
if config.skip_leading_rows is None:
del config.skip_leading_rows
if ('destinationEncryptionConfiguration' in resource

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.


def __init__(self):
self._properties = {}
self._kms_key_name = None

This comment was marked as spam.

This comment was marked as spam.


@kms_key_name.setter
def kms_key_name(self, value):
if not isinstance(value, six.string_types) and value is not None:

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Copy link
Contributor

@tswast tswast left a comment

Choose a reason for hiding this comment

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

Unapproving, since I do agree with Jon's comments.

vitaliili and others added 7 commits February 7, 2018 18:21
Include EncryptionConfiguration in BigQuery module.

Use _properties for EncryptionConfiguration implementation.
Note: I use _properties and kwargs because we want to be able to explicitly set kmsKeyName to None to allow unsetting it.
Also, fix links to job configs for
destination_encryption_configurations.
Copy link
Contributor

@tswast tswast left a comment

Choose a reason for hiding this comment

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

Thanks @vitaliili, I've made a few additional changes to the docstrings and EncryptionConfiguration class.

@jonparrott I think this is ready for a second pass at review.

@tswast
Copy link
Contributor

tswast commented Feb 8, 2018

Note: I've added code sample snippets for all customer-managed encryption key operations in #4852, which should also serve well as system tests. (The tests all pass)


@destination_encryption_configuration.setter
def destination_encryption_configuration(self, value):
self._properties[

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.


def __init__(self, **kwargs):
self._properties = {}
if 'kms_key_name' in kwargs:

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@theacodes
Copy link
Contributor

lgtm once you appease the ci

@tswast tswast merged commit 438f4a3 into googleapis:master Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants