Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove warnings in samples which appear in the Kokoro logs #1195

Open
parthea opened this issue Dec 2, 2023 · 0 comments
Open

Remove warnings in samples which appear in the Kokoro logs #1195

parthea opened this issue Dec 2, 2023 · 0 comments
Assignees
Labels
api: storage Issues related to the googleapis/python-storage API. samples Issues that are directly related to samples. type: cleanup An internal cleanup or hygiene concern.

Comments

@parthea
Copy link
Contributor

parthea commented Dec 2, 2023

__________________________ test_storage_compose_file ___________________________

test_bucket = 

    def test_storage_compose_file(test_bucket):
        source_files = ["test_upload_blob_1", "test_upload_blob_2"]
        for source in source_files:
            blob = test_bucket.blob(source)
            blob.upload_from_string(source)
    
        with tempfile.NamedTemporaryFile() as dest_file:
            destination = storage_compose_file.compose_file(
                test_bucket.name,
                source_files[0],
                source_files[1],
                dest_file.name,
            )
>           composed = destination.download_as_string()
....
E       PendingDeprecationWarning: Blob.download_as_string() is deprecated and will be removed in future. Use Blob.download_as_bytes() instead.
________________________ ERROR at setup of test_get_rpo ________________________

    @pytest.fixture
    def dual_region_bucket():
        """Yields a dual region bucket that is deleted after the test completes."""
        bucket = None
        while bucket is None or bucket.exists():
            bucket_name = f"bucket-lock-{uuid.uuid4()}"
            bucket = storage.Client().bucket(bucket_name)
>           bucket.location = "NAM4"

rpo_test.py:33: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = 
value = 'NAM4'

    @location.setter
    def location(self, value):
        """(Deprecated) Set `Bucket.location`
    
        This can only be set at bucket **creation** time.
    
        See https://cloud.google.com/storage/docs/json_api/v1/buckets and
        https://cloud.google.com/storage/docs/bucket-locations
    
        .. warning::
    
            Assignment to 'Bucket.location' is deprecated, as it is only
            valid before the bucket is created. Instead, pass the location
            to `Bucket.create`.
        """
>       warnings.warn(_LOCATION_SETTER_MESSAGE, DeprecationWarning, stacklevel=2)
E       DeprecationWarning: Assignment to 'Bucket.location' is deprecated, as it is only valid before the bucket is created. Instead, pass the location to `Bucket.create`.
@parthea parthea added the type: cleanup An internal cleanup or hygiene concern. label Dec 2, 2023
@product-auto-label product-auto-label bot added api: storage Issues related to the googleapis/python-storage API. samples Issues that are directly related to samples. labels Dec 2, 2023
parthea added a commit that referenced this issue Dec 2, 2023
@cojenco cojenco self-assigned this Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/python-storage API. samples Issues that are directly related to samples. type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
Development

No branches or pull requests

2 participants