From 7bf901ddb4d1edb1be2bea7d1b6f700b348f6d90 Mon Sep 17 00:00:00 2001 From: Natan Viana Date: Thu, 18 May 2023 09:30:11 -0300 Subject: [PATCH 1/8] Implements connection pool for postgres online store Signed-off-by: Natan Viana --- .../infra/online_stores/contrib/postgres.py | 15 +++++++++------ .../infra/utils/postgres/connection_utils.py | 17 +++++++++++++++++ .../infra/utils/postgres/postgres_config.py | 2 ++ 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/sdk/python/feast/infra/online_stores/contrib/postgres.py b/sdk/python/feast/infra/online_stores/contrib/postgres.py index 144b242a1d..28ae1a72a2 100644 --- a/sdk/python/feast/infra/online_stores/contrib/postgres.py +++ b/sdk/python/feast/infra/online_stores/contrib/postgres.py @@ -3,6 +3,7 @@ from datetime import datetime from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple +import contextlib import psycopg2 import pytz from psycopg2 import sql @@ -13,26 +14,28 @@ from feast.feature_view import FeatureView from feast.infra.key_encoding_utils import serialize_entity_key from feast.infra.online_stores.online_store import OnlineStore -from feast.infra.utils.postgres.connection_utils import _get_conn +from feast.infra.utils.postgres.connection_utils import _get_connection_pool from feast.infra.utils.postgres.postgres_config import PostgreSQLConfig from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto from feast.protos.feast.types.Value_pb2 import Value as ValueProto from feast.repo_config import RepoConfig from feast.usage import log_exceptions_and_usage - class PostgreSQLOnlineStoreConfig(PostgreSQLConfig): type: Literal["postgres"] = "postgres" class PostgreSQLOnlineStore(OnlineStore): - _conn: Optional[psycopg2._psycopg.connection] = None + _conn_pool: Optional[psycopg2.pool.SimpleConnectionPool] = None + @contextlib.contextmanager def _get_conn(self, config: RepoConfig): - if not self._conn: + if not self._conn_pool: assert config.online_store.type == "postgres" - self._conn = _get_conn(config.online_store) - return self._conn + self._conn_pool = _get_connection_pool(config.online_store) + connection = self._conn_pool.getconn() + yield connection + self._conn_pool.putconn(connection) @log_exceptions_and_usage(online_store="postgres") def online_write_batch( diff --git a/sdk/python/feast/infra/utils/postgres/connection_utils.py b/sdk/python/feast/infra/utils/postgres/connection_utils.py index 0e9cbf96fe..c87c50b705 100644 --- a/sdk/python/feast/infra/utils/postgres/connection_utils.py +++ b/sdk/python/feast/infra/utils/postgres/connection_utils.py @@ -26,6 +26,23 @@ def _get_conn(config: PostgreSQLConfig): return conn +def _get_connection_pool(config: PostgreSQLConfig): + return psycopg2.pool.SimpleConnectionPool( + config.min_conn, + config.max_conn, + dbname=config.database, + host=config.host, + port=int(config.port), + user=config.user, + password=config.password, + sslmode=config.sslmode, + sslkey=config.sslkey_path, + sslcert=config.sslcert_path, + sslrootcert=config.sslrootcert_path, + options="-c search_path={}".format(config.db_schema or config.user), + ) + + def _df_to_create_table_sql(entity_df, table_name) -> str: pa_table = pa.Table.from_pandas(entity_df) columns = [ diff --git a/sdk/python/feast/infra/utils/postgres/postgres_config.py b/sdk/python/feast/infra/utils/postgres/postgres_config.py index f22cc6c204..947ff0757e 100644 --- a/sdk/python/feast/infra/utils/postgres/postgres_config.py +++ b/sdk/python/feast/infra/utils/postgres/postgres_config.py @@ -6,6 +6,8 @@ class PostgreSQLConfig(FeastConfigBaseModel): + min_conn: int = 1 + max_conn: int = 10 host: StrictStr port: int = 5432 database: StrictStr From 0e0157c6a021406c96867bb86ade3e13b4f837fe Mon Sep 17 00:00:00 2001 From: Natan Viana Date: Mon, 22 May 2023 08:48:25 -0300 Subject: [PATCH 2/8] Connection type configurable Signed-off-by: Natan Viana --- sdk/python/feast/infra/utils/postgres/postgres_config.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sdk/python/feast/infra/utils/postgres/postgres_config.py b/sdk/python/feast/infra/utils/postgres/postgres_config.py index 947ff0757e..dcab9b1e42 100644 --- a/sdk/python/feast/infra/utils/postgres/postgres_config.py +++ b/sdk/python/feast/infra/utils/postgres/postgres_config.py @@ -1,13 +1,18 @@ from typing import Optional -from pydantic import StrictStr +from pydantic import StrictStr, validator from feast.repo_config import FeastConfigBaseModel +class Connection(Enum): + singleton = 'singleton' + pool = 'pool' + class PostgreSQLConfig(FeastConfigBaseModel): min_conn: int = 1 max_conn: int = 10 + conn_type: Connection = Connection.singleton host: StrictStr port: int = 5432 database: StrictStr @@ -18,3 +23,4 @@ class PostgreSQLConfig(FeastConfigBaseModel): sslkey_path: Optional[StrictStr] = None sslcert_path: Optional[StrictStr] = None sslrootcert_path: Optional[StrictStr] = None + keepalives_idle = 200, From 5571a904a96f1747009f43d4a9010772a20305bf Mon Sep 17 00:00:00 2001 From: Natan Viana Date: Mon, 22 May 2023 09:01:28 -0300 Subject: [PATCH 3/8] Postgres online store with connection type configurable Signed-off-by: Natan Viana --- .../infra/online_stores/contrib/postgres.py | 22 ++++++++++++------- .../infra/utils/postgres/connection_utils.py | 1 + .../infra/utils/postgres/postgres_config.py | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/sdk/python/feast/infra/online_stores/contrib/postgres.py b/sdk/python/feast/infra/online_stores/contrib/postgres.py index 28ae1a72a2..fe3ad20907 100644 --- a/sdk/python/feast/infra/online_stores/contrib/postgres.py +++ b/sdk/python/feast/infra/online_stores/contrib/postgres.py @@ -14,8 +14,8 @@ from feast.feature_view import FeatureView from feast.infra.key_encoding_utils import serialize_entity_key from feast.infra.online_stores.online_store import OnlineStore -from feast.infra.utils.postgres.connection_utils import _get_connection_pool -from feast.infra.utils.postgres.postgres_config import PostgreSQLConfig +from feast.infra.utils.postgres.connection_utils import _get_connection_pool, _get +from feast.infra.utils.postgres.postgres_config import PostgreSQLConfig, Connection from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto from feast.protos.feast.types.Value_pb2 import Value as ValueProto from feast.repo_config import RepoConfig @@ -26,16 +26,22 @@ class PostgreSQLOnlineStoreConfig(PostgreSQLConfig): class PostgreSQLOnlineStore(OnlineStore): + _conn: Optional[psycopg2._psycopg.connection] = None _conn_pool: Optional[psycopg2.pool.SimpleConnectionPool] = None @contextlib.contextmanager def _get_conn(self, config: RepoConfig): - if not self._conn_pool: - assert config.online_store.type == "postgres" - self._conn_pool = _get_connection_pool(config.online_store) - connection = self._conn_pool.getconn() - yield connection - self._conn_pool.putconn(connection) + assert config.online_store.type == "postgres" + if config.online_store.conn_type == Connection.pool: + if not self._conn_pool: + self._conn_pool = _get_connection_pool(config.online_store) + connection = self._conn_pool.getconn() + yield connection + self._conn_pool.putconn(connection) + else: + if not self._conn: + self._conn = _get_conn(config.online_store) + yield self._conn @log_exceptions_and_usage(online_store="postgres") def online_write_batch( diff --git a/sdk/python/feast/infra/utils/postgres/connection_utils.py b/sdk/python/feast/infra/utils/postgres/connection_utils.py index c87c50b705..a51d79790f 100644 --- a/sdk/python/feast/infra/utils/postgres/connection_utils.py +++ b/sdk/python/feast/infra/utils/postgres/connection_utils.py @@ -22,6 +22,7 @@ def _get_conn(config: PostgreSQLConfig): sslcert=config.sslcert_path, sslrootcert=config.sslrootcert_path, options="-c search_path={}".format(config.db_schema or config.user), + keepalives_idle=config.keepalives_idle ) return conn diff --git a/sdk/python/feast/infra/utils/postgres/postgres_config.py b/sdk/python/feast/infra/utils/postgres/postgres_config.py index dcab9b1e42..00639ecb0b 100644 --- a/sdk/python/feast/infra/utils/postgres/postgres_config.py +++ b/sdk/python/feast/infra/utils/postgres/postgres_config.py @@ -23,4 +23,4 @@ class PostgreSQLConfig(FeastConfigBaseModel): sslkey_path: Optional[StrictStr] = None sslcert_path: Optional[StrictStr] = None sslrootcert_path: Optional[StrictStr] = None - keepalives_idle = 200, + keepalives_idle: int = 0 From 30e601c0e8199b6063f20ba90df971c2979944b3 Mon Sep 17 00:00:00 2001 From: Natan Viana Date: Mon, 22 May 2023 09:06:24 -0300 Subject: [PATCH 4/8] Fix imports Signed-off-by: Natan Viana --- sdk/python/feast/infra/online_stores/contrib/postgres.py | 2 +- sdk/python/feast/infra/utils/postgres/postgres_config.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/python/feast/infra/online_stores/contrib/postgres.py b/sdk/python/feast/infra/online_stores/contrib/postgres.py index fe3ad20907..6ae8a9d4f6 100644 --- a/sdk/python/feast/infra/online_stores/contrib/postgres.py +++ b/sdk/python/feast/infra/online_stores/contrib/postgres.py @@ -14,7 +14,7 @@ from feast.feature_view import FeatureView from feast.infra.key_encoding_utils import serialize_entity_key from feast.infra.online_stores.online_store import OnlineStore -from feast.infra.utils.postgres.connection_utils import _get_connection_pool, _get +from feast.infra.utils.postgres.connection_utils import _get_connection_pool, _get_conn from feast.infra.utils.postgres.postgres_config import PostgreSQLConfig, Connection from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto from feast.protos.feast.types.Value_pb2 import Value as ValueProto diff --git a/sdk/python/feast/infra/utils/postgres/postgres_config.py b/sdk/python/feast/infra/utils/postgres/postgres_config.py index 00639ecb0b..cff8dbea7f 100644 --- a/sdk/python/feast/infra/utils/postgres/postgres_config.py +++ b/sdk/python/feast/infra/utils/postgres/postgres_config.py @@ -1,6 +1,6 @@ from typing import Optional -from pydantic import StrictStr, validator +from pydantic import StrictStr from feast.repo_config import FeastConfigBaseModel From c3998e8a13b31fa5df747f7676f15be7b753b2b3 Mon Sep 17 00:00:00 2001 From: Natan Viana Date: Mon, 22 May 2023 17:27:13 -0300 Subject: [PATCH 5/8] Writes integration test to validate postgres connection pool Signed-off-by: Natan Viana --- .../infra/online_stores/contrib/postgres.py | 4 +- .../infra/utils/postgres/postgres_config.py | 4 +- sdk/python/tests/conftest.py | 14 ++++++ .../online_store/test_universal_online.py | 50 ++++++++++++++----- 4 files changed, 55 insertions(+), 17 deletions(-) diff --git a/sdk/python/feast/infra/online_stores/contrib/postgres.py b/sdk/python/feast/infra/online_stores/contrib/postgres.py index 6ae8a9d4f6..83ade9bbc3 100644 --- a/sdk/python/feast/infra/online_stores/contrib/postgres.py +++ b/sdk/python/feast/infra/online_stores/contrib/postgres.py @@ -15,7 +15,7 @@ from feast.infra.key_encoding_utils import serialize_entity_key from feast.infra.online_stores.online_store import OnlineStore from feast.infra.utils.postgres.connection_utils import _get_connection_pool, _get_conn -from feast.infra.utils.postgres.postgres_config import PostgreSQLConfig, Connection +from feast.infra.utils.postgres.postgres_config import PostgreSQLConfig, ConnectionType from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto from feast.protos.feast.types.Value_pb2 import Value as ValueProto from feast.repo_config import RepoConfig @@ -32,7 +32,7 @@ class PostgreSQLOnlineStore(OnlineStore): @contextlib.contextmanager def _get_conn(self, config: RepoConfig): assert config.online_store.type == "postgres" - if config.online_store.conn_type == Connection.pool: + if config.online_store.conn_type == ConnectionType.pool: if not self._conn_pool: self._conn_pool = _get_connection_pool(config.online_store) connection = self._conn_pool.getconn() diff --git a/sdk/python/feast/infra/utils/postgres/postgres_config.py b/sdk/python/feast/infra/utils/postgres/postgres_config.py index cff8dbea7f..47b6efa173 100644 --- a/sdk/python/feast/infra/utils/postgres/postgres_config.py +++ b/sdk/python/feast/infra/utils/postgres/postgres_config.py @@ -5,14 +5,14 @@ from feast.repo_config import FeastConfigBaseModel -class Connection(Enum): +class ConnectionType(Enum): singleton = 'singleton' pool = 'pool' class PostgreSQLConfig(FeastConfigBaseModel): min_conn: int = 1 max_conn: int = 10 - conn_type: Connection = Connection.singleton + conn_type: ConnectionType = ConnectionType.singleton host: StrictStr port: int = 5432 database: StrictStr diff --git a/sdk/python/tests/conftest.py b/sdk/python/tests/conftest.py index e1ae5f7a42..d53bf96882 100644 --- a/sdk/python/tests/conftest.py +++ b/sdk/python/tests/conftest.py @@ -393,3 +393,17 @@ def feature_store_for_online_retrieval( ] return fs, feature_refs, entity_rows + + +@pytest.fixture +def fake_ingest_data(): + """Fake data to ingest into the feature store""" + data = { + "driver_id": [1], + "conv_rate": [0.5], + "acc_rate": [0.6], + "avg_daily_trips": [4], + "event_timestamp": [pd.Timestamp(datetime.datetime.utcnow()).round("ms")], + "created": [pd.Timestamp(datetime.datetime.utcnow()).round("ms")], + } + return pd.DataFrame(data) diff --git a/sdk/python/tests/integration/online_store/test_universal_online.py b/sdk/python/tests/integration/online_store/test_universal_online.py index 51f39a5667..484a1cd9b5 100644 --- a/sdk/python/tests/integration/online_store/test_universal_online.py +++ b/sdk/python/tests/integration/online_store/test_universal_online.py @@ -30,11 +30,46 @@ driver_feature_view, ) from tests.utils.data_source_test_creator import prep_file_source +from feast.infra.utils.postgres.postgres_config import ConnectionType + + +@pytest.mark.integration +@pytest.mark.universal_online_stores(only=["postgres"]) +def test_connection_pool_online_stores(environment, universal_data_sources, fake_ingest_data): + if os.getenv("FEAST_IS_LOCAL_TEST", "False") == "True": + return + fs = environment.feature_store + fs.config.online_store.conn_type = ConnectionType.pool + fs.config.online_store.min_conn = 1 + fs.config.online_store.max_conn = 10 + + entities, datasets, data_sources = universal_data_sources + driver_hourly_stats = create_driver_hourly_stats_feature_view(data_sources.driver) + driver_entity = driver() + + # Register Feature View and Entity + fs.apply([driver_hourly_stats, driver_entity]) + + # directly ingest data into the Online Store + fs.write_to_online_store("driver_stats", fake_ingest_data) + + # assert the right data is in the Online Store + df = fs.get_online_features( + features=[ + "driver_stats:avg_daily_trips", + "driver_stats:acc_rate", + "driver_stats:conv_rate", + ], + entity_rows=[{"driver_id": 1}], + ).to_df() + assertpy.assert_that(df["avg_daily_trips"].iloc[0]).is_equal_to(4) + assertpy.assert_that(df["acc_rate"].iloc[0]).is_close_to(0.6, 1e-6) + assertpy.assert_that(df["conv_rate"].iloc[0]).is_close_to(0.5, 1e-6) @pytest.mark.integration @pytest.mark.universal_online_stores(only=["redis"]) -def test_entity_ttl_online_store(environment, universal_data_sources): +def test_entity_ttl_online_store(environment, universal_data_sources, fake_ingest_data): if os.getenv("FEAST_IS_LOCAL_TEST", "False") == "True": return fs = environment.feature_store @@ -47,19 +82,8 @@ def test_entity_ttl_online_store(environment, universal_data_sources): # Register Feature View and Entity fs.apply([driver_hourly_stats, driver_entity]) - # fake data to ingest into Online Store - data = { - "driver_id": [1], - "conv_rate": [0.5], - "acc_rate": [0.6], - "avg_daily_trips": [4], - "event_timestamp": [pd.Timestamp(datetime.datetime.utcnow()).round("ms")], - "created": [pd.Timestamp(datetime.datetime.utcnow()).round("ms")], - } - df_ingest = pd.DataFrame(data) - # directly ingest data into the Online Store - fs.write_to_online_store("driver_stats", df_ingest) + fs.write_to_online_store("driver_stats", fake_ingest_data) # assert the right data is in the Online Store df = fs.get_online_features( From 890f6ce1be8a7a86ee5ad92a5d1fc4ae658a8bdc Mon Sep 17 00:00:00 2001 From: Felix Wang Date: Sat, 3 Jun 2023 18:23:06 -0700 Subject: [PATCH 6/8] Fix Signed-off-by: Felix Wang --- sdk/python/feast/infra/online_stores/contrib/postgres.py | 7 ++++--- sdk/python/feast/infra/utils/postgres/connection_utils.py | 2 +- sdk/python/feast/infra/utils/postgres/postgres_config.py | 6 ++++-- .../integration/online_store/test_universal_online.py | 6 ++++-- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/sdk/python/feast/infra/online_stores/contrib/postgres.py b/sdk/python/feast/infra/online_stores/contrib/postgres.py index 83ade9bbc3..f496574ce3 100644 --- a/sdk/python/feast/infra/online_stores/contrib/postgres.py +++ b/sdk/python/feast/infra/online_stores/contrib/postgres.py @@ -1,9 +1,9 @@ +import contextlib import logging from collections import defaultdict from datetime import datetime from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple -import contextlib import psycopg2 import pytz from psycopg2 import sql @@ -14,13 +14,14 @@ from feast.feature_view import FeatureView from feast.infra.key_encoding_utils import serialize_entity_key from feast.infra.online_stores.online_store import OnlineStore -from feast.infra.utils.postgres.connection_utils import _get_connection_pool, _get_conn -from feast.infra.utils.postgres.postgres_config import PostgreSQLConfig, ConnectionType +from feast.infra.utils.postgres.connection_utils import _get_conn, _get_connection_pool +from feast.infra.utils.postgres.postgres_config import ConnectionType, PostgreSQLConfig from feast.protos.feast.types.EntityKey_pb2 import EntityKey as EntityKeyProto from feast.protos.feast.types.Value_pb2 import Value as ValueProto from feast.repo_config import RepoConfig from feast.usage import log_exceptions_and_usage + class PostgreSQLOnlineStoreConfig(PostgreSQLConfig): type: Literal["postgres"] = "postgres" diff --git a/sdk/python/feast/infra/utils/postgres/connection_utils.py b/sdk/python/feast/infra/utils/postgres/connection_utils.py index a51d79790f..c3d036e0b0 100644 --- a/sdk/python/feast/infra/utils/postgres/connection_utils.py +++ b/sdk/python/feast/infra/utils/postgres/connection_utils.py @@ -22,7 +22,7 @@ def _get_conn(config: PostgreSQLConfig): sslcert=config.sslcert_path, sslrootcert=config.sslrootcert_path, options="-c search_path={}".format(config.db_schema or config.user), - keepalives_idle=config.keepalives_idle + keepalives_idle=config.keepalives_idle, ) return conn diff --git a/sdk/python/feast/infra/utils/postgres/postgres_config.py b/sdk/python/feast/infra/utils/postgres/postgres_config.py index 47b6efa173..9fbaed474d 100644 --- a/sdk/python/feast/infra/utils/postgres/postgres_config.py +++ b/sdk/python/feast/infra/utils/postgres/postgres_config.py @@ -1,3 +1,4 @@ +from enum import Enum from typing import Optional from pydantic import StrictStr @@ -6,8 +7,9 @@ class ConnectionType(Enum): - singleton = 'singleton' - pool = 'pool' + singleton = "singleton" + pool = "pool" + class PostgreSQLConfig(FeastConfigBaseModel): min_conn: int = 1 diff --git a/sdk/python/tests/integration/online_store/test_universal_online.py b/sdk/python/tests/integration/online_store/test_universal_online.py index 484a1cd9b5..8218971315 100644 --- a/sdk/python/tests/integration/online_store/test_universal_online.py +++ b/sdk/python/tests/integration/online_store/test_universal_online.py @@ -17,6 +17,7 @@ from feast.feature_service import FeatureService from feast.feature_view import FeatureView from feast.field import Field +from feast.infra.utils.postgres.postgres_config import ConnectionType from feast.online_response import TIMESTAMP_POSTFIX from feast.types import Float32, Int32, String from feast.wait import wait_retry_backoff @@ -30,12 +31,13 @@ driver_feature_view, ) from tests.utils.data_source_test_creator import prep_file_source -from feast.infra.utils.postgres.postgres_config import ConnectionType @pytest.mark.integration @pytest.mark.universal_online_stores(only=["postgres"]) -def test_connection_pool_online_stores(environment, universal_data_sources, fake_ingest_data): +def test_connection_pool_online_stores( + environment, universal_data_sources, fake_ingest_data +): if os.getenv("FEAST_IS_LOCAL_TEST", "False") == "True": return fs = environment.feature_store From cdea74d40938472add566b8bab95f3cba2005caa Mon Sep 17 00:00:00 2001 From: Felix Wang Date: Sat, 3 Jun 2023 18:39:15 -0700 Subject: [PATCH 7/8] Fix Signed-off-by: Felix Wang --- sdk/python/feast/infra/online_stores/contrib/postgres.py | 3 ++- sdk/python/feast/infra/utils/postgres/connection_utils.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sdk/python/feast/infra/online_stores/contrib/postgres.py b/sdk/python/feast/infra/online_stores/contrib/postgres.py index f496574ce3..a12e66f109 100644 --- a/sdk/python/feast/infra/online_stores/contrib/postgres.py +++ b/sdk/python/feast/infra/online_stores/contrib/postgres.py @@ -8,6 +8,7 @@ import pytz from psycopg2 import sql from psycopg2.extras import execute_values +from psycopg2.pool import SimpleConnectionPool from pydantic.schema import Literal from feast import Entity @@ -28,7 +29,7 @@ class PostgreSQLOnlineStoreConfig(PostgreSQLConfig): class PostgreSQLOnlineStore(OnlineStore): _conn: Optional[psycopg2._psycopg.connection] = None - _conn_pool: Optional[psycopg2.pool.SimpleConnectionPool] = None + _conn_pool: Optional[SimpleConnectionPool] = None @contextlib.contextmanager def _get_conn(self, config: RepoConfig): diff --git a/sdk/python/feast/infra/utils/postgres/connection_utils.py b/sdk/python/feast/infra/utils/postgres/connection_utils.py index c3d036e0b0..0d99c8ab99 100644 --- a/sdk/python/feast/infra/utils/postgres/connection_utils.py +++ b/sdk/python/feast/infra/utils/postgres/connection_utils.py @@ -5,6 +5,7 @@ import psycopg2 import psycopg2.extras import pyarrow as pa +from psycopg2.pool import SimpleConnectionPool from feast.infra.utils.postgres.postgres_config import PostgreSQLConfig from feast.type_map import arrow_to_pg_type @@ -28,7 +29,7 @@ def _get_conn(config: PostgreSQLConfig): def _get_connection_pool(config: PostgreSQLConfig): - return psycopg2.pool.SimpleConnectionPool( + return SimpleConnectionPool( config.min_conn, config.max_conn, dbname=config.database, From 0900dfb8c0645ffff3b6c59b85305ea8db75028c Mon Sep 17 00:00:00 2001 From: Felix Wang Date: Sat, 3 Jun 2023 19:28:39 -0700 Subject: [PATCH 8/8] Fix Signed-off-by: Felix Wang --- sdk/python/tests/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/python/tests/conftest.py b/sdk/python/tests/conftest.py index d53bf96882..728bd9b34f 100644 --- a/sdk/python/tests/conftest.py +++ b/sdk/python/tests/conftest.py @@ -403,7 +403,7 @@ def fake_ingest_data(): "conv_rate": [0.5], "acc_rate": [0.6], "avg_daily_trips": [4], - "event_timestamp": [pd.Timestamp(datetime.datetime.utcnow()).round("ms")], - "created": [pd.Timestamp(datetime.datetime.utcnow()).round("ms")], + "event_timestamp": [pd.Timestamp(datetime.utcnow()).round("ms")], + "created": [pd.Timestamp(datetime.utcnow()).round("ms")], } return pd.DataFrame(data)