get_connection is a BaseHook method that retrieves an Airflow connection by identifier from the metastore. Custom hooks use the returned configuration to obtain schema, host, port, login, and password values. section 9.2.1
MovielensHook configuration
After creating a connection with identifier movielens, a hook retrieves it with config = self.get_connection(self._conn_id), then constructs the API base URL and authenticated session from config.
