Skip to content

Commit

Permalink
add get_redis_client from prefeitura_rio package
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellcassius committed Dec 13, 2023
1 parent bf1ca97 commit 0f48560
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
1 change: 1 addition & 0 deletions pipelines/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
)
from pipelines.utils.secret import get_secret
from prefeitura_rio.pipelines_utils.dbt import run_dbt_model
from prefeitura_rio.pipelines_utils.redis_pal import get_redis_client
from prefeitura_rio.pipelines_utils.infisical import inject_bd_credentials
from prefeitura_rio.pipelines_utils.logging import log

Expand Down
17 changes: 1 addition & 16 deletions pipelines/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

from prefeitura_rio.pipelines_utils.logging import log #TODO: add or relocate imports
from prefeitura_rio.pipelines_utils.infisical import get_secret
from prefeitura_rio.pipelines_utils.redis_pal import get_redis_client

# Set BD config to run on cloud #
bd.config.from_file = True
Expand Down Expand Up @@ -157,22 +158,6 @@ def get_table_min_max_value( # pylint: disable=R0913

return result.iloc[0][0]

def get_redis_client(
host: str = "redis.redis.svc.cluster.local",
port: int = 6379,
db: int = 0, # pylint: disable=C0103
password: str = None,
) -> RedisPal:
"""
Returns a Redis client.
"""
return RedisPal(
host=host,
port=port,
db=db,
password=password,
)

def get_last_run_timestamp(dataset_id: str, table_id: str, mode: str = "prod") -> str:
"""
Query redis to retrive the time for when the last materialization
Expand Down

0 comments on commit 0f48560

Please sign in to comment.