You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
In storage.Key.get_contents_to_filename, improve error checking and exception handling and add timestamp to file object #148
# TODO: Add good error checking.# TODO: Add good exception handling.# TODO: Set timestamp? Make optional, default being to set it if possible?
Also, consider renaming get_contents_to_filename and get_contents_to_file. The get is a misleading verb, since a read into a file is what is happening.
b7f1b774 (JJ Geewax 2014-01-29 18:02:29 -0500 169) # TODO: Add good error checking.
b7f1b774 (JJ Geewax 2014-01-29 18:02:29 -0500 170) # TODO: Add good exception handling.
b7f1b774 (JJ Geewax 2014-01-29 18:02:29 -0500 171) # TODO: Set timestamp? Make optional, default being to set it if possible?
@jgeewax WRT raising / handling errors: the open() call will raise IOError on failure: ISTM that we can just let that error propagate, as with any error raised by self.get_contents_to_file().
WRT the timestamp: we open the file in 'wb' mode, which will cause its mtime to be updated by the OS. Are you suggesting that we set the timestamp to a different value (e.g., based on some metadata?) We aren't saving any such metadata when uploading.
@tseaver : Re open() call, you mean if the filename is invalid ? i agree it's fine to let that propagate up.. i wouldn't expect that error to get caught.
Re timestamp: I think my thought was that we could set the last modified time of the local file to the last modified time of the object in GCS. i wouldn't mind if we decided to scrap that all together though...
WRT naming: I like @tseaver proposal. If we do the change, I think we should make the naming uniform for all the get_contents_* and save_contents_* methods (a total of 6).
Activity
dhermes commentedon Sep 22, 2014
git blameoutputtseaver commentedon Oct 28, 2014
@jgeewax WRT raising / handling errors: the
open()call will raise IOError on failure: ISTM that we can just let that error propagate, as with any error raised byself.get_contents_to_file().WRT the timestamp: we open the file in 'wb' mode, which will cause its mtime to be updated by the OS. Are you suggesting that we set the timestamp to a different value (e.g., based on some metadata?) We aren't saving any such metadata when uploading.
jgeewax commentedon Oct 29, 2014
@dhermes : The naming was based on boto's names.
@tseaver : Re
open()call, you mean if the filename is invalid ? i agree it's fine to let that propagate up.. i wouldn't expect that error to get caught.Re timestamp: I think my thought was that we could set the last modified time of the local file to the last modified time of the object in GCS. i wouldn't mind if we decided to scrap that all together though...
tseaver commentedon Oct 29, 2014
WRT naming: I would prefer names like
save_contents_to_filenameandupload_contents_from_filename, which make the directionality unambiguous.#311 tracks the enhancement for synchronizing the file's mtime.
silvolu commentedon Oct 29, 2014
WRT naming: I like @tseaver proposal. If we do the change, I think we should make the naming uniform for all the get_contents_* and save_contents_* methods (a total of 6).
jgeewax commentedon Oct 30, 2014
Do we have any objections to keeping the old names as aliases ? (And noting those aliases in the docs?)
I'd like it to be relatively easy to move from boto -> gcloud -- and aliases don't really hurt... right?
Contact: now tracks it's inner state
Contact: Fixed googleapis#148
80 remaining items
chore: migrate default branch from master to main (#148)
docs: explain how to use repeated struct.Value (#148)
chore: release 1.26.1 (#148)
ci: prototype running lint / mypy / unit tests / coverage as GH actio…
fix: avoid out-of-range nanoseconds field in pandas 1.5.x (#148)
chore(python): Enable size-label bot (#148)
build(deps): [autoapprove] bump certifi from 2022.12.7 to 2023.7.22 (#…
build(python): exit with success status if no samples found (#148)
chore: Re-generated to pick up changes from synthtool. (#148)
Implement Global Cache (memcache) (#148)
Allow customizing the GCE metadata service address via an env var. (#148
dbapi: fix "Column not found" error when inserting rows with quoted c…
feat: add support for Point In Time Recovery (PITR) (#148)
test: fix PITR restored database version time assertion (#238)
chore: release 1.3.1 (#148)