Skip to content

Commit

Permalink
deepcopying request for getReport2 to avoid later modification
Browse files Browse the repository at this point in the history
  • Loading branch information
pitchmuc committed Jun 19, 2023
1 parent 16273f5 commit afc25e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aanalytics2/aanalytics2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3030,6 +3030,7 @@ def getReport2(
else:
raise ValueError("Require a JSON or Dictionary to request data")
### Settings
dataRequest = deepcopy(dataRequest)
dataRequest["settings"]["page"] = 0
dataRequest["settings"]["limit"] = limit
if returnsNone:
Expand All @@ -3048,6 +3049,7 @@ def getReport2(
dataRequest["rsid"] = rsid
if ignoreZeroes:
dataRequest.get("statistics",{'ignoreZeroes':True})["ignoreZeroes"] = True
deepCopyRequest = deepcopy(dataRequest)
### Request data
if self.loggingEnabled:
self.logger.debug(f"getReport request: {json.dumps(dataRequest,indent=4)}")
Expand Down Expand Up @@ -3159,7 +3161,7 @@ def getReport2(
## Using the class
data = Workspace(
responseData=preparedData,
dataRequest=dataRequest,
dataRequest=deepCopyRequest,
columns=columns,
summaryData=summaryData,
analyticsConnector=self,
Expand Down

0 comments on commit afc25e2

Please sign in to comment.