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

incremental and sync parameters are not exclusive #321

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 2 additions & 5 deletions tabcmd/commands/extracts/refresh_extracts_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def define_args(refresh_extract_parser):
set_calculations_options(group)
set_project_arg(group)
set_parent_project_arg(group)
set_sync_wait_options(group)

@staticmethod
def run_command(args):
Expand All @@ -31,14 +32,11 @@ def run_command(args):
server = session.create_session(args, logger)

if args.addcalculations or args.removecalculations:
logger.warning("Add/Remove Calculations tasks are not yet implemented.")
logger.warning("Add/Remove Calculations tasks are not supported.")

# are these two mandatory? mutually exclusive?
# docs: the REST method always runs a full refresh even if the refresh type is set to incremental.
if args.incremental: # docs: run the incremental refresh
logger.warn("Incremental refresh is not yet available through the new tabcmd")
# if args.synchronous: # docs: run a full refresh and poll until it completes
# else: run a full refresh but don't poll for completion

try:
item = Extracts.get_wb_or_ds_for_extracts(args, logger, server)
Expand All @@ -54,7 +52,6 @@ def run_command(args):

logger.info(_("common.output.job_queued_success"))
logger.debug("Extract refresh queued with JobID: {}".format(job.id))

if args.synchronous:
# maintains a live connection to the server while the refresh operation is underway, polling every second
# until the background job is done. <job id="JOB_ID" mode="MODE" type="RefreshExtract" />
Expand Down
15 changes: 9 additions & 6 deletions tabcmd/execution/global_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def set_append_replace_option(parser):
)

# what's the difference between this and 'overwrite'?
# This is meant for when a) the local file is an extract b) the server item is an existing data source
# This one replaces the data but not the metadata
append_group.add_argument(
"--replace",
action="store_true",
Expand All @@ -355,7 +355,7 @@ def set_append_replace_option(parser):
)


# this is meant to be like replacing like
# this is meant to be publish the whole thing on top of what's there
def set_overwrite_option(parser):
parser.add_argument(
"-o",
Expand All @@ -368,13 +368,16 @@ def set_overwrite_option(parser):

# refresh-extracts
def set_incremental_options(parser):
sync_group = parser.add_mutually_exclusive_group()
sync_group.add_argument("--incremental", action="store_true", help="Runs the incremental refresh operation.")
sync_group.add_argument(
parser.add_argument("--incremental", action="store_true", help="Runs the incremental refresh operation.")
return parser


def set_sync_wait_options(parser):
parser.add_argument(
"--synchronous",
action="store_true",
help="Adds the full refresh operation to the queue used by the Backgrounder process, to be run as soon as a \
Backgrounder process is available.",
Backgrounder process is available. The program will wait until the job has finished or the timeout has been reached.",
)
return parser

Expand Down
Loading