Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added multiple cycle upload argument #27

Merged
merged 4 commits into from
Nov 15, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pyseed/seed_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ def get_meter_data(self, property_id, interval: str = 'Exact', excluded_meter_id
def save_meter_data(self, property_id: int, meter_id: int, meter_data) -> dict:
pass

def start_save_data(self, import_file_id: int) -> dict:
def start_save_data(self, import_file_id: int, multiple_cycle_upload: bool) -> dict:
"""start the background process to save the data file to the database.
This is the state before the mapping.

Expand All @@ -1039,7 +1039,8 @@ def start_save_data(self, import_file_id: int) -> dict:
return self.client.post(
"import_files_start_save_data_pk",
url_args={"PK": import_file_id},
json={"cycle_id": self.cycle_id},
json={"cycle_id": self.cycle_id,
"multiple_cycle_upload": multiple_cycle_upload},
)

def start_map_data(self, import_file_id: int) -> dict:
Expand Down Expand Up @@ -1177,6 +1178,7 @@ def upload_and_match_datafile(
column_mapping_profile_name: str,
column_mappings_file: str,
import_meters_if_exist: bool = False,
multiple_cycle_upload: bool = False,
**kwargs,
) -> dict:
"""Upload a file to the cycle_id that is defined in the constructor. This carries the
Expand All @@ -1200,7 +1202,7 @@ def upload_and_match_datafile(
import_file_id = result["import_file_id"]

# start processing
result = self.start_save_data(import_file_id)
result = self.start_save_data(import_file_id, multiple_cycle_upload)
progress_key = result.get("progress_key", None)

# wait until upload is complete
Expand Down