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

Added new files to firestore folder #36

Merged

Conversation

Aniket-Parlikar
Copy link
Contributor

Developed a Cloud Function that is triggered when an image file is deleted from the street2sat-uploaded bucket and then proceeds to delete the corresponding record from the Firestore DB.

@@ -0,0 +1,35 @@
#The given script creates a CLoud Function to that is triggered when an image file is deleted from the street2sat-uploaded bucket
#and then proceeds to delete the corresponding record from the Firestore DB.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Inline comments should start with space: https://peps.python.org/pep-0008/#inline-comments

doc.delete()
logger.info("Document has been deleted.")
else:
logger.info('No such record associated with the image file exists in the Firestore DB!')
Copy link
Contributor

Choose a reason for hiding this comment

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

Some of the logs end with punctuation and some don't, best to be consistent

@@ -0,0 +1,3 @@
# Function dependencies, for example:
# package>=version
google-cloud-firestore
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the package not available by default in the Cloud Functions environment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No it is needed to be mentioned in the requirements.txt file, else we get an error

@ivanzvonkov
Copy link
Contributor

  1. There's a gcp folder in this repository which is more fitting for this script
  2. Could you add the line used to deploy this function to the deploy script? https://github.com/nasaharvest/street2sat/blob/main/deploy.sh
  3. I think the function name: delete-street2sat-prediction may be a little more obvious. What do you think?

Code looks good!

@ivanzvonkov ivanzvonkov linked an issue Aug 5, 2022 that may be closed by this pull request
@Aniket-Parlikar
Copy link
Contributor Author

I have made the necessary changes as requested. Please check and let me know in case any additional changes are needed.

Added deploy command for the street2sat delete function
Copy link
Contributor

@ivanzvonkov ivanzvonkov left a comment

Choose a reason for hiding this comment

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

LGTM! There are still some comments without a space after # but everything else is good. You can go ahead and merge.

@Aniket-Parlikar Aniket-Parlikar merged commit ab9c573 into nasaharvest:main Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Google Cloud function that updates firestore on delete
2 participants