cjapy 0.2.3.post3__tar.gz → 0.2.3.post4__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.
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/PKG-INFO +1 -1
- cjapy-0.2.3.post4/cjapy/__version__.py +1 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/cjapy/cjapy.py +17 -14
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/cjapy/workspace.py +3 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/cjapy.egg-info/PKG-INFO +1 -1
- cjapy-0.2.3.post3/cjapy/__version__.py +0 -1
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/LICENSE +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/README.md +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/cjapy/__init__.py +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/cjapy/config.py +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/cjapy/configs.py +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/cjapy/connector.py +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/cjapy/projects.py +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/cjapy/requestCreator.py +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/cjapy/token_provider.py +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/cjapy.egg-info/SOURCES.txt +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/cjapy.egg-info/dependency_links.txt +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/cjapy.egg-info/requires.txt +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/cjapy.egg-info/top_level.txt +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/docs/authenticating_without_config_json.md +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/docs/cja.md +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/docs/getting_started.md +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/docs/logging.md +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/docs/main.md +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/docs/projects.md +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/docs/releases.md +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/docs/requestCreator.md +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/docs/workspace.md +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/pyproject.toml +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/requirements.txt +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/setup.cfg +0 -0
- {cjapy-0.2.3.post3 → cjapy-0.2.3.post4}/setup.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.3-4"
|
|
@@ -720,7 +720,7 @@ class CJA:
|
|
|
720
720
|
raise ValueError("Require a Data View ID")
|
|
721
721
|
if self.loggingEnabled:
|
|
722
722
|
self.logger.debug(f"getDimensions start")
|
|
723
|
-
path = f"/
|
|
723
|
+
path = f"/data/dataviews/{dataviewId}/dimensions"
|
|
724
724
|
params = {"page":0}
|
|
725
725
|
if full:
|
|
726
726
|
params[
|
|
@@ -764,7 +764,7 @@ class CJA:
|
|
|
764
764
|
raise ValueError("Require a Dimension ID")
|
|
765
765
|
if self.loggingEnabled:
|
|
766
766
|
self.logger.debug(f"getDimension start, id: {dimensionId}")
|
|
767
|
-
path = f"/
|
|
767
|
+
path = f"/data/dataviews/{dataviewId}/dimensions/{dimensionId}"
|
|
768
768
|
params = {}
|
|
769
769
|
if full:
|
|
770
770
|
params[
|
|
@@ -794,7 +794,7 @@ class CJA:
|
|
|
794
794
|
raise ValueError("Require a Data View ID")
|
|
795
795
|
if self.loggingEnabled:
|
|
796
796
|
self.logger.debug(f"getMetrics start")
|
|
797
|
-
path = f"/
|
|
797
|
+
path = f"/data/dataviews/{dataviewId}/metrics"
|
|
798
798
|
params = {"page":0}
|
|
799
799
|
if full:
|
|
800
800
|
params[
|
|
@@ -835,7 +835,7 @@ class CJA:
|
|
|
835
835
|
raise ValueError("Require a Dimension ID")
|
|
836
836
|
if self.loggingEnabled:
|
|
837
837
|
self.logger.debug(f"getMetric start, id: {metricId}")
|
|
838
|
-
path = f"/
|
|
838
|
+
path = f"/data/dataviews/{dataviewId}/metrics/{metricId}"
|
|
839
839
|
params = {}
|
|
840
840
|
if full:
|
|
841
841
|
params[
|
|
@@ -873,7 +873,7 @@ class CJA:
|
|
|
873
873
|
"""
|
|
874
874
|
if self.loggingEnabled:
|
|
875
875
|
self.logger.debug(f"getDataViews start, output: {output}")
|
|
876
|
-
path = "/
|
|
876
|
+
path = "/data/dataviews"
|
|
877
877
|
params = {
|
|
878
878
|
"limit": limit,
|
|
879
879
|
"includeType": includeType,
|
|
@@ -921,7 +921,7 @@ class CJA:
|
|
|
921
921
|
raise ValueError("dataViewId is required")
|
|
922
922
|
if self.loggingEnabled:
|
|
923
923
|
self.logger.debug(f"getDataView start")
|
|
924
|
-
path = f"/
|
|
924
|
+
path = f"/data/dataviews/{dataViewId}"
|
|
925
925
|
params = {}
|
|
926
926
|
if full:
|
|
927
927
|
params[
|
|
@@ -943,7 +943,7 @@ class CJA:
|
|
|
943
943
|
"""
|
|
944
944
|
if self.loggingEnabled:
|
|
945
945
|
self.logger.debug(f"getConnections start")
|
|
946
|
-
path = f"/
|
|
946
|
+
path = f"/data/connections"
|
|
947
947
|
params = {"limit":limit,"page":0}
|
|
948
948
|
if full:
|
|
949
949
|
params["expansion"] ="granularBackfills,granularStreaming,backfillsSummaryConnection,name,description,isDeleted,isDisabled,dataSets,createdDate,modified,sandboxName,organization,backfillEnabled,modifiedBy,ownerFullName"
|
|
@@ -968,7 +968,7 @@ class CJA:
|
|
|
968
968
|
"""
|
|
969
969
|
if connectionId is None:
|
|
970
970
|
raise ValueError("Require a connection ID")
|
|
971
|
-
path = f"/
|
|
971
|
+
path = f"/data/connections/{connectionId}"
|
|
972
972
|
params = {'expansion':"granularBackfills,granularStreaming,backfillsSummaryConnection,name,description,isDeleted,isDisabled,dataSets,createdDate,modified,sandboxName,organization,backfillEnabled,modifiedBy,ownerFullName"}
|
|
973
973
|
res = self.connector.getData(self.endpoint + path,params=params, **kwargs)
|
|
974
974
|
return res
|
|
@@ -983,7 +983,7 @@ class CJA:
|
|
|
983
983
|
raise ValueError("Require information to be passed for data view creation")
|
|
984
984
|
if self.loggingEnabled:
|
|
985
985
|
self.logger.debug(f"validateDataView start")
|
|
986
|
-
path = "/
|
|
986
|
+
path = "/data/dataviews/validate"
|
|
987
987
|
if ".json" in data:
|
|
988
988
|
with open(data, "r") as f:
|
|
989
989
|
data = json.load(f)
|
|
@@ -1008,7 +1008,7 @@ class CJA:
|
|
|
1008
1008
|
common timezone: US/Montain, US/Pacific, US/Michigan, US/Central, Europe/London, Europe/Paris, Asia/Tokyo, Australia/Sydney
|
|
1009
1009
|
minuteInactivity : OPTIONAL : number of minutes of inactivity before closing a session
|
|
1010
1010
|
"""
|
|
1011
|
-
path = "/
|
|
1011
|
+
path = "/data/dataviews/"
|
|
1012
1012
|
if data is None and name is None and connectionId is None:
|
|
1013
1013
|
raise ValueError("Require information to be passed for data view creation")
|
|
1014
1014
|
if data is not None:
|
|
@@ -1053,7 +1053,7 @@ class CJA:
|
|
|
1053
1053
|
raise ValueError("Require a data view ID")
|
|
1054
1054
|
if self.loggingEnabled:
|
|
1055
1055
|
self.logger.debug(f"deleteDataView start, id: {dataViewId}")
|
|
1056
|
-
path = f"/
|
|
1056
|
+
path = f"/data/dataviews/{dataViewId}"
|
|
1057
1057
|
res = self.connector.deleteData(self.endpoint + path)
|
|
1058
1058
|
return res
|
|
1059
1059
|
|
|
@@ -1074,7 +1074,7 @@ class CJA:
|
|
|
1074
1074
|
raise ValueError("Require data to be passed for the update")
|
|
1075
1075
|
if self.loggingEnabled:
|
|
1076
1076
|
self.logger.debug(f"updateDataView start, id: {dataViewId}")
|
|
1077
|
-
path = f"/
|
|
1077
|
+
path = f"/data/dataviews/{dataViewId}"
|
|
1078
1078
|
if ".json" in data:
|
|
1079
1079
|
with open(data, "r", encoding=kwargs.get("encoding", "utf-8")) as f:
|
|
1080
1080
|
data = json.load(f.read())
|
|
@@ -1091,7 +1091,7 @@ class CJA:
|
|
|
1091
1091
|
raise ValueError("Require a data view ID")
|
|
1092
1092
|
if self.loggingEnabled:
|
|
1093
1093
|
self.logger.debug(f"copyDataView start, id: {dataViewId}")
|
|
1094
|
-
path = f"/
|
|
1094
|
+
path = f"/data/dataviews/copy/{dataViewId}"
|
|
1095
1095
|
res = self.connector.putData(self.endpoint + path, **kwargs)
|
|
1096
1096
|
return res
|
|
1097
1097
|
|
|
@@ -2051,7 +2051,7 @@ class CJA:
|
|
|
2051
2051
|
segmentApplied[obj["id"]] = obj["dateRange"]
|
|
2052
2052
|
### table columnIds and StaticRow IDs
|
|
2053
2053
|
tableColumnIds = {
|
|
2054
|
-
obj["columnId"]: obj
|
|
2054
|
+
obj["columnId"]: obj.get("filters",[])[0]
|
|
2055
2055
|
for obj in dataRequest["metricContainer"]["metrics"]
|
|
2056
2056
|
}
|
|
2057
2057
|
### create relations for metrics with Filter on top
|
|
@@ -2176,6 +2176,7 @@ class CJA:
|
|
|
2176
2176
|
dataRows = res.get("rows")
|
|
2177
2177
|
columns = res.get("columns")
|
|
2178
2178
|
summaryData = res.get("summaryData")
|
|
2179
|
+
resultsTruncated = res.get("resultsTruncated")
|
|
2179
2180
|
totalElements = res.get("numberOfElements")
|
|
2180
2181
|
lastPage = res.get("lastPage", True)
|
|
2181
2182
|
if float(len(dataRows)) >= float(n_results):
|
|
@@ -2237,6 +2238,7 @@ class CJA:
|
|
|
2237
2238
|
self.logger.debug(f"reportType: {reportType}")
|
|
2238
2239
|
columns = None ## no "columns" key in response
|
|
2239
2240
|
summaryData = res.get("summaryData")
|
|
2241
|
+
resultsTruncated = res.get("resultsTruncated")
|
|
2240
2242
|
(
|
|
2241
2243
|
nb_columns,
|
|
2242
2244
|
tableColumnIds,
|
|
@@ -2279,6 +2281,7 @@ class CJA:
|
|
|
2279
2281
|
dataRequest=dataRequest,
|
|
2280
2282
|
columns=columns,
|
|
2281
2283
|
summaryData=summaryData,
|
|
2284
|
+
resultsTruncated=resultsTruncated,
|
|
2282
2285
|
cjaConnector=self,
|
|
2283
2286
|
reportType=reportType,
|
|
2284
2287
|
metrics=metricColumns, ## for normal type ## for staticReport
|
|
@@ -21,6 +21,7 @@ class Workspace:
|
|
|
21
21
|
dataRequest: dict = None,
|
|
22
22
|
columns: dict = None,
|
|
23
23
|
summaryData: dict = None,
|
|
24
|
+
resultsTruncated: bool = False,
|
|
24
25
|
cjaConnector: object = None,
|
|
25
26
|
reportType: str = "normal",
|
|
26
27
|
metrics: Union[dict, list] = None, ## for normal type, static report
|
|
@@ -34,6 +35,7 @@ class Workspace:
|
|
|
34
35
|
dataRequest : REQUIRED : dataRequest containing the request
|
|
35
36
|
columns : REQUIRED : the columns element of the response.
|
|
36
37
|
summaryData : REQUIRED : summary data containing total calculated by CJA
|
|
38
|
+
resultsTruncated : OPTIONAL : whether or not the results returned were truncated
|
|
37
39
|
cjaConnector : REQUIRED : cja connector.
|
|
38
40
|
reportType : OPTIONAL : define type of report retrieved.(normal, static, multi)
|
|
39
41
|
metrics : OPTIONAL : dictionary of the columns Id for normal report and list of columns name for Static report
|
|
@@ -50,6 +52,7 @@ class Workspace:
|
|
|
50
52
|
self.settings = dataRequest["settings"]
|
|
51
53
|
self.pageRequested = dataRequest["settings"]["page"] + 1
|
|
52
54
|
self.summaryData = summaryData
|
|
55
|
+
self.resultsTruncated = resultsTruncated
|
|
53
56
|
self.reportType = reportType
|
|
54
57
|
self.cjaConnector = cjaConnector
|
|
55
58
|
## global filters resolution
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.3-3"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|