From db2e871e969835b33377a26329ee425c7b7bb928 Mon Sep 17 00:00:00 2001 From: Michael F Date: Tue, 7 Nov 2023 13:31:53 +0100 Subject: [PATCH] create default config on create schema --- CHANGELOG.md | 9 +++++++++ Makefile | 2 +- src/graphsenselib/schema/schema.py | 12 ++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9377290..938c339 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). + +## [23.09/1.8.3] 2023-11-07 +### fixed +- ingest default config to raw keyspace on create to avoid problems. + +## [23.09/1.8.2] 2023-10-24 +### fixed +- catch error on coinmarketcap problems + ## [23.09/1.8.1] 2023-10-06 ### fixed - handle zcash shielded inputs in import diff --git a/Makefile b/Makefile index 005499b..5cf26c6 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ SHELL := /bin/bash PROJECT := graphsense-lib VENV := venv RELEASE := 'v23.09' -RELEASESEM := 'v1.8.2' +RELEASESEM := 'v1.8.3' all: format lint test build diff --git a/src/graphsenselib/schema/schema.py b/src/graphsenselib/schema/schema.py index 369aeba..961dca6 100644 --- a/src/graphsenselib/schema/schema.py +++ b/src/graphsenselib/schema/schema.py @@ -237,6 +237,18 @@ def create_keyspace_if_not_exist(self, env, currency, keyspace_type): f"with replication config {replication_config}." ) + if not keyspacedb.is_configuration_populated(): + config_defaults = ( + config.get_keyspace_config(env, currency) + .keyspace_setup_config[keyspace_type] + .data_configuration + ) + logger.warning( + "Config table in transformed not populated." + f" Setting default values {config_defaults}." + ) + keyspacedb.ingest("configuration", [config_defaults]) + def create_new_transformed_ks_if_not_exist(self, env, currency, suffix=None): keyspace_type = "transformed" with DbFactory().from_config(env, currency) as db: