I have a Python project using click args where an argument should be in tuple(string,float) format and can accept multiple instances of the arg.
@click.option(
"--metric-and-lift",
multiple=True,
type=(str, float),
help="The list of key metric & corresponding expected lift to detect. Provide `[metric_name] [lift]`, \
e.g. 1% lift in net revenue as `net_revenue 0.01`",
)
I also have a gcloud command which attempts to create & run a Vertex AI job with an image of this project and args to match the tuple(string,float) format.
gcloud ai custom-jobs create \
--region us-central1 \
--service-account $(USERNAME)@$(GCP_PROJECT) \
--display-name=$(DISPLAY_NAME) \
--project=$(GCP_PROJECT) \
--worker-pool-spec=machine-type=m1-ultramem-40,replica-count=1,container-image-uri=$(CONTAINER_IMAGE_LOCATION) \
--command="poetry,run,power_analysis_cli" \
--args=--metric-and-lift=impression,0.01,--metric-and-lift=click,0.01,--metric-and-lift=install,0.01,--metric-and-lift=revenue,0.01,--metric-and-lift=spend,0.01,--metric-and-lift=net_rev,0.01
I am running into an issue with the gcloud CLI where it is erroring out due to values being specified multiple times. It looks like the command is evaluating 0.01 individually several times instead of clumping it together with the preceding string (ex. impression,0.01).
ERROR: (gcloud.ai.custom-jobs.create) argument --args: "0.01" cannot be specified multiple times
Interestingly enough, I can launch this job successfully if I append 0's to the left hand side of the float value (ex. --metric-and-lift=revenue,00.01) so that none of the floats exactly match one another.
Is there a better way of handling this case in Vertex AI? It would be great to keep the existing --metric-and-lift=$(STRING),$(FLOAT) format since that converts to the pattern python click args expects when running the gcloud Vertex AI command.
Sorry but if I understand it will set at 0.01 at all the proceeding argument in the command ? so completely removing it after the first argument is okay ?
I replicated the error but it changed when I removed the 0.01 on the next arguments sample:
I removed some of the commands/flags since I cannot reproduce your data but am able to reproduce the error using just what I posted above.