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

[DataLake][SetExpiry]Set Expiry of DataLake File #11629

Closed
wants to merge 5 commits into from

Conversation

xiafu-msft
Copy link
Contributor

No description provided.

xiafu-msft and others added 5 commits May 12, 2020 14:14
* [Blob][Swagger]Regenerate Swagger Code

* fix container test failure caused by list_containers include type change
* initial avro parser

* try fixing test...

* falling in love with python compatibility...

* make linter happy.

* raise StopIteration when there is no more bytes instead of tracking file length.

* async avro parser

* fix syntax for Python 3.5

* get rid of 'readers_schema' as we only honor schema that has been written to file ('writer_schema').

* pr feedback

* trim unused code.

* pr feedback.

* simplify skip sync in next.

* move avro tests from _shared.
* wip

* initial test coverage.

* wip.

* wip

* single upload.

* add async tests.

* disable 50k block tests.

* datalake append.

* async datalake

* disable tests that send large payload over network.

* pr feedback.
cpk_info=cpk_info,
**kwargs)
except StorageErrorException as error:
process_storage_error(error)
blob_props.name = self.blob_name
blob_props.container = self.container_name
if isinstance(blob_props, BlobProperties):
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use

try: 
 ## 
except AttributeError:
 ###

If mypy is complaining, use cast()

cpk_info=cpk_info,
**kwargs)
except StorageErrorException as error:
process_storage_error(error)
blob_props.name = self.blob_name
blob_props.container = self.container_name
if isinstance(blob_props, BlobProperties):
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

https://docs.python.org/2/glossary.html#term-eafp

interesting read about why - Easier to ask for forgiveness than permission

return self._get_path_properties(cls=FileProperties._deserialize_file_properties, **kwargs) # pylint: disable=protected-access

def set_file_expiry(self, expiry_options, expires_on=None, **kwargs):
# type: (**Any) -> None
Copy link
Contributor

Choose a reason for hiding this comment

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

wrong type hint

self.lease = None
self.last_modified = None
self.creation_time = None
self.metadata = kwargs.get('metadata')
Copy link
Contributor

Choose a reason for hiding this comment

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

should these all be kwargs.get('metadata', None)

Copy link
Member

Choose a reason for hiding this comment

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

That's not needed - get already returns None by default.

self.state = None
self.duration = None
def __init__(self, **kwargs):
super(LeaseProperties, self).__init__(
Copy link
Contributor

Choose a reason for hiding this comment

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

i dont think this init is needed to just call the super

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree!

return await self._get_path_properties(cls=FileProperties._deserialize_file_properties, **kwargs) # pylint: disable=protected-access

async def set_file_expiry(self, expiry_options, expires_on=None, **kwargs):
# type: (**Any) -> None
Copy link
Contributor

Choose a reason for hiding this comment

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

wrong type hint

Copy link
Contributor

@rakshith91 rakshith91 left a comment

Choose a reason for hiding this comment

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

Thanks, just a few minor comments :)

@annatisch annatisch added the Storage Storage Service (Queues, Blobs, Files) label Jun 2, 2020
@xiafu-msft xiafu-msft added the APIChange This PR contains an addition or change to the API signature and must be reviewed by an architect. label Jun 3, 2020
@xiafu-msft xiafu-msft closed this Jul 7, 2020
@xiafu-msft xiafu-msft mentioned this pull request Jul 21, 2020
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-python that referenced this pull request Nov 15, 2020
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-python that referenced this pull request Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APIChange This PR contains an addition or change to the API signature and must be reviewed by an architect. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants