educative.io

Where is dsdemo.json?

Where is dsdemo.json?


Course: Data Science in Production: Building Scalable Model Pipelines - Learn Interactively
Lesson: Sklearn Workflow

Hi @F_T !!
In the lesson, both “dsdemo.json” and “creds.json” are mentioned in the context of setting up authentication credentials for Google Cloud Platform (GCP) services, specifically for accessing BigQuery.

The script references “dsdemo.json” when setting the environment variable GOOGLE_APPLICATION_CREDENTIALS, which specifies the path to the JSON file containing the service account credentials needed for authentication. However, in the provided Python code snippet, the file “creds.json” is used to load the service account credentials directly:

credentials = service_account.Credentials.from_service_account_file('creds.json')

This line implies that the script expects a file named “creds.json” to be present in the same directory where the script is executed. This JSON file should contain the necessary service account credentials for authenticating with GCP services, such as BigQuery.

Therefore, if you’re running the script locally or in any environment, you need to ensure that either “creds.json” or “dsdemo.json” (whichever contains the correct service account credentials) is present in the directory where the script is executed. Additionally, ensure that the JSON file contains valid authentication information, including the project ID, private key ID, private key, client email, client ID, etc., as mentioned in the lesson.

If “creds.json” is indeed the correct file name, ensure it contains the appropriate authentication information. If using “dsdemo.json,” adjust the script to reference that file instead. Finally, set the GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of the JSON file to enable the script to locate and use the credentials for authentication purposes.
I hope it helps. Happy Learning :blush: