Open edump72 opened 5 months ago
Which version of the library are you using?
Hey @edump72. Trying something similar, I cannot reproduce this issue. I get an error with the field name you're using:
ValueError: Path Oración not consumed, residue: ón
Here's the code example I used:
from firebase_functions import firestore_fn
@firestore_fn.on_document_created(document='Solicitud desde Android Studio/Entidades')
def on_post_created(event: firestore_fn.Event[firestore_fn.DocumentSnapshot]):
print(event.data)
if event.data is None:
return
try:
event.data.get("Oración")
except KeyError:
return
Edit: This is the fill stack trace I get on emulators. Same is applicable for deployed functions as well:
Oh....is this an issue of Python and "non-ASCII" characters in field names? Firestore is documented as supporting valid UTF-8 characters in field names, but maybe there's an issue with how Python is dealing with those strings?
[I haven't done a lot of Python coding in a long time, but I did suffer somewhat through the non-UTF8 wars of Python 2 vs. 3 ...]
I believe that is a separate issue and not one with this SDK but rather upstream with the Google Cloud SDK we use internally. But what I don't get is how this error with datacontenttype
occurred. My current speculation is that OP is using an older version of Google Cloud SDK which didn't have this issue but got another one by other means. This would mean that Google Cloud SDK has a regression. I'll raise this Unicode issue with the Firebase team, and keep this issue open for OP to respond if they can provide us with a reproducible sample
I am creating a Google Cloud Function using a Python script, in order to handle the creation of a new document in my Firestore database. When the data of the new document is fetched, I create an SVG with it using Spacy. I have used the documentation in order to handle this event : https://firebase.google.com/docs/functions/firestore-events?hl=es-419&gen=2nd#python-preview_1
This is my Python script :
I have deployed the function using Google Cloud Console, setting everything correctly. The function is accepted, but when I enter a trigger event: ,my Firestore database continues as it was and I get this error :
Anyone knows what is the problem? Thank you in advance!