File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
ex-submodules/django-datawarehouse/warehouse/management/commands Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 77class Command(BaseCommand):
88
99 help = "Run the data warehouse"
10- args = "<start_date> <end_date>"
11- label = ""
1210
1311 def add_arguments(self, parser):
12+ parser.add_argument(
13+ '--start-date',
14+ dest='start_date',
15+ help='Start date for the warehouse run',
16+ default=None,
17+ )
18+ parser.add_argument(
19+ '--end-date',
20+ dest='end_date',
21+ help='End date for the warehouse run',
22+ default=None,
23+ )
1424 parser.add_argument(
1525 '--cleanup',
1626 action='store_true',
@@ -20,7 +30,7 @@ def add_arguments(self, parser):
2030 )
2131
2232 def handle(self, *args, **options):
23- start_date = None if len(args) < 1 else string_to_datetime(args[0])
24- end_date = None if len(args) < 2 else string_to_datetime(args[1])
33+ start_date = string_to_datetime(options["start_date"]) if options["start_date"] else None
34+ end_date = string_to_datetime(options["end_date"]) if options["end_date"] else None
2535 cleanup = options["cleanup"]
2636 return runner.update_warehouse(start_date, end_date, cleanup)
You can’t perform that action at this time.
0 commit comments