Konstantin
02/01/2022, 12:41 PMHello everyone, I can't figure out how to use native libraries in Prefect, for example "prefect.tasks.gsheets"
Give an example of the code for using this class
Anna Geller
Konstantin
02/01/2022, 12:45 PMKonstantin
02/01/2022, 12:49 PMi have the string "<https://docs.google.com/spreadsheets/d/15FMPFFa5KFsLPo7JRsJf2Zz>..." and the sheet_name
Anna Geller
ReadGsheetRow(credentials_filename=None, sheet_key=None, worksheet_name=None, **kwargs)
Konstantin
02/01/2022, 1:08 PMAnna Geller
Konstantin
02/01/2022, 1:09 PMfrom prefect.tasks.gsheets import gsheets
filename=None
key=<https://docs.google.com/spreadsheets/d/15FMPFFa5KFsLPo7JRsJf2Zz>.."
worksheet="sheet_name"
value = gsheets.ReadGsheetRow(credentials_filename=filename, sheet_key=key, worksheet_name=worksheet)
Anna Geller
"15FMPFFa5KFsLPo7JRsJf2Zz"
and credentials file is a local path to your Google JSON file from Google API - did you generate that?Anna Geller
Konstantin
02/01/2022, 1:14 PMAnna Geller
Konstantin
02/01/2022, 1:15 PMsomething like that
Konstantin
02/01/2022, 1:17 PMKonstantin
02/01/2022, 1:18 PMAnna Geller
Konstantin
02/01/2022, 1:35 PMKonstantin
02/01/2022, 1:36 PMtry now
Anna Geller
Anna Geller
Konstantin
02/01/2022, 1:46 PMAnna Geller
Anna Geller
flow.run()
command or using prefect run
CLI) and once that’s finished you can look at how you can deploy it to Prefect Cloud - what do you think?Konstantin
02/01/2022, 1:56 PMKonstantin
02/01/2022, 1:59 PMAnna Geller
Konstantin
02/01/2022, 2:15 PM