Skip to content

Commit 1df04da

Browse files
authored
feat(native): Cube.py - support semanticLayerSync/schemaVersion (#7124)
1 parent 9aed9ac commit 1df04da

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/cubejs-backend-native/python/cube/src/conf/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ class Configuration:
5151
scheduled_refresh_contexts: Callable
5252
context_to_api_scopes: Callable
5353
repository_factory: Callable
54+
schema_version: Callable[[RequestContext], str]
55+
semantic_layer_sync: Callable
5456

5557
def __init__(self):
5658
self.schema_path = None
@@ -76,6 +78,8 @@ def __init__(self):
7678
self.scheduled_refresh_contexts = None
7779
self.context_to_api_scopes = None
7880
self.repository_factory = None
81+
self.schema_version = None
82+
self.semantic_layer_sync = None
7983

8084
def set_schema_path(self, schema_path: str):
8185
self.schema_path = schema_path
@@ -140,5 +144,11 @@ def set_scheduled_refresh_contexts(self, scheduled_refresh_contexts: Callable):
140144
def set_repository_factory(self, repository_factory: Callable):
141145
self.repository_factory = repository_factory
142146

147+
def set_schema_version(self, schema_version: Callable[[RequestContext], str]):
148+
self.schema_version = schema_version
149+
150+
def set_semantic_layer_sync(self, semantic_layer_sync: Callable):
151+
self.semantic_layer_sync = semantic_layer_sync
152+
143153

144154
settings = Configuration()

packages/cubejs-backend-native/src/python/cube_config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ impl CubeConfigPy {
4545
self.function_attr(config_module, "scheduled_refresh_contexts")?;
4646
self.function_attr(config_module, "context_to_api_scopes")?;
4747
self.function_attr(config_module, "repository_factory")?;
48+
self.function_attr(config_module, "semantic_layer_sync")?;
49+
self.function_attr(config_module, "schema_version")?;
4850

4951
Ok(())
5052
}

0 commit comments

Comments
 (0)