kobai-sdk 0.3.5rc3__tar.gz → 0.3.5rc6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. {kobai_sdk-0.3.5rc3/kobai_sdk.egg-info → kobai_sdk-0.3.5rc6}/PKG-INFO +1 -1
  2. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/kobai/tenant_client.py +23 -12
  3. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6/kobai_sdk.egg-info}/PKG-INFO +1 -1
  4. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/pyproject.toml +1 -1
  5. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/LICENSE +0 -0
  6. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/MANIFEST.in +0 -0
  7. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/README.md +0 -0
  8. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/kobai/__init__.py +0 -0
  9. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/kobai/ai_query.py +0 -0
  10. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/kobai/ai_rag.py +0 -0
  11. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/kobai/databricks_client.py +0 -0
  12. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/kobai/demo_tenant_client.py +0 -0
  13. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/kobai/genie.py +0 -0
  14. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/kobai/mobi.py +0 -0
  15. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/kobai/mobi_config.py +0 -0
  16. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/kobai/ms_authenticate.py +0 -0
  17. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/kobai/spark_client.py +0 -0
  18. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/kobai/tenant_api.py +0 -0
  19. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/kobai_sdk.egg-info/SOURCES.txt +0 -0
  20. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/kobai_sdk.egg-info/dependency_links.txt +0 -0
  21. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/kobai_sdk.egg-info/requires.txt +0 -0
  22. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/kobai_sdk.egg-info/top_level.txt +0 -0
  23. {kobai_sdk-0.3.5rc3 → kobai_sdk-0.3.5rc6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kobai-sdk
3
- Version: 0.3.5rc3
3
+ Version: 0.3.5rc6
4
4
  Summary: A package that enables interaction with a Kobai tenant.
5
5
  Author-email: Ryan Oattes <ryan@kobai.io>
6
6
  License: Apache License
@@ -219,13 +219,13 @@ class TenantClient:
219
219
  else:
220
220
  return True
221
221
 
222
- def spark_generate_genie_views(self, domains = None, concepts = None, not_concepts=None, enforce_map=True):
222
+ def spark_generate_genie_views(self, domains = None, concepts = None, not_concepts=None, enforce_map=True, local=False):
223
223
 
224
224
  """
225
225
  Use the Spark Client to generate views for this tenant required to populate a Genie Data Room.
226
226
  """
227
227
 
228
- tables = self.__get_view_sql(domains=domains, concepts=concepts, not_concepts=not_concepts, enforce_map=enforce_map)
228
+ tables = self.__get_view_sql(local, domains=domains, concepts=concepts, not_concepts=not_concepts, enforce_map=enforce_map)
229
229
  for t in tables:
230
230
  #print(t["sql"])
231
231
  try:
@@ -235,13 +235,13 @@ class TenantClient:
235
235
  print(t["sql"])
236
236
  print("Updated " + str(len(tables)) + " views for Genie.")
237
237
 
238
- def spark_remove_genie_views(self):
238
+ def spark_remove_genie_views(self, local=False):
239
239
 
240
240
  """
241
241
  Use the Spark Client to remove any views previously created for this tenant.
242
242
  """
243
243
 
244
- tables = self.__get_view_sql()
244
+ tables = self.__get_view_sql(local)
245
245
  for t in tables:
246
246
  self.spark_client._SparkClient__run_sql("DROP VIEW " + t["table"])
247
247
  print("Removed " + str(len(tables)) + " views.")
@@ -263,7 +263,7 @@ class TenantClient:
263
263
 
264
264
  self.databricks_client = databricks_client.DatabricksClient(notebook_context, warehouse_id)
265
265
 
266
- def databricks_build_genie(self, domains=None, concepts=None, not_concepts=None, enforce_map=True, add_questions=False):
266
+ def databricks_build_genie(self, domains=None, concepts=None, not_concepts=None, enforce_map=True, add_questions=False, local=False):
267
267
 
268
268
  """
269
269
  Use the Databricks Client to create a Genie Data Room for this tenant.
@@ -280,7 +280,7 @@ class TenantClient:
280
280
  response = self.databricks_client._DatabricksClient__api_post("/api/2.0/data-rooms", payload)
281
281
  room_id = response["id"]
282
282
 
283
- for t in self.__get_view_sql(domains=domains, concepts=concepts, not_concepts=not_concepts, enforce_map=enforce_map):
283
+ for t in self.__get_view_sql(local, domains=domains, concepts=concepts, not_concepts=not_concepts, enforce_map=enforce_map):
284
284
  payload["table_identifiers"].append(t["table"])
285
285
  print(t["table"])
286
286
  response = self.databricks_client._DatabricksClient__api_patch("/api/2.0/data-rooms/" + room_id, payload)
@@ -326,15 +326,26 @@ class TenantClient:
326
326
  # Semantic Profile
327
327
  ########################################
328
328
 
329
- def __get_descriptions(self):
329
+ #def get_descriptions(self):
330
+ # response = self.api_client._TenantAPI__run_get("/episteme-svcs/api/descriptions", params={"schema": self.schema})
331
+ # return response.json()
330
332
 
331
- tenant_config = self.get_tenant_config()
332
- descriptions = get_genie_descriptions(self.model_id, tenant_config, self.schema)
333
- return descriptions
333
+ def __get_descriptions(self, local):
334
334
 
335
- def __get_view_sql(self, domains=None, concepts=None, not_concepts=None, enforce_map=True):
335
+ if local:
336
+ tenant_config = self.get_tenant_config()
337
+ descriptions = get_genie_descriptions(self.model_id, tenant_config, self.schema)
338
+ return descriptions
339
+ else:
340
+ response = self.api_client._TenantAPI__run_get("/episteme-svcs/api/descriptions", params={"schema": self.schema})
341
+ return response.json()
342
+ #tenant_config = self.get_tenant_config()
343
+ #descriptions = get_genie_descriptions(self.model_id, tenant_config, self.schema)
344
+ #return descriptions
345
+
346
+ def __get_view_sql(self, local, domains=None, concepts=None, not_concepts=None, enforce_map=True):
336
347
  sql_list = []
337
- descriptions = self.__get_descriptions()
348
+ descriptions = self.__get_descriptions(local)
338
349
 
339
350
  for dom in descriptions["domains"]:
340
351
  for con in dom["concepts"]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kobai-sdk
3
- Version: 0.3.5rc3
3
+ Version: 0.3.5rc6
4
4
  Summary: A package that enables interaction with a Kobai tenant.
5
5
  Author-email: Ryan Oattes <ryan@kobai.io>
6
6
  License: Apache License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "kobai-sdk"
7
- version = "0.3.5rc3"
7
+ version = "0.3.5rc6"
8
8
  description = "A package that enables interaction with a Kobai tenant."
9
9
  readme = "README.md"
10
10
  authors = [{ name = "Ryan Oattes", email = "ryan@kobai.io" }]
File without changes
File without changes
File without changes
File without changes
File without changes