From the course: Data Quality Testing with Great Expectations

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Creating a data source

Creating a data source

Let me first walk you through creating a data source to connect to the PostgreSQL database that contains the sample data. A data source in GX is a configuration for accessing and interacting with data from a wide variety of source systems, like SQL databases, bucket storage, or web APIs. Alright, now that we know what a data source is, let's continue with a sample code in our Jupyter notebook and create one. To make things easier for you, we have already set up the full Postgres database connection as an environment variable in the docker container, so you don't have to type out the username and password. Let's get the database connection into a variable in the Jupyter notebook so we can connect it from gx. Simply type the following into a cell and execute it. Again, this is just a variable assignment, so you're not going to see any output, but you shouldn't see any arrows either. We already have a data context in our notebook, so now we can create a Postgres data source using a…

Contents