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

Sensible placement of the codegen argument #125

Open
gordonwatts opened this issue May 22, 2024 · 1 comment
Open

Sensible placement of the codegen argument #125

gordonwatts opened this issue May 22, 2024 · 1 comment
Labels
enhancement New feature or request servicex Related to SX tests
Milestone

Comments

@gordonwatts
Copy link
Member

Nominally, the codegen and the content of the query go hand-in-hand.

For example, here build_query builds the query as a func_adl. Another query could be built
here and could require a different backend.

def build_query(name: str) -> Tuple[FuncADLQuery, str]:
    if name == "xaod_all":
        return (query_xaod_all(), "atlasr22")
    elif name == "xaod_medium":
        return (query_xaod_medium(), "atlasr22")
    elif name == "xaod_small":
        return (query_xaod_small(), "atlasr22")
    else:
        raise ValueError(f"Unknown query type {name}")

When passing this information to the SX front end for the query:

    spec = sx.ServiceXSpec(
        General=sx.General(
            ServiceX="atlasr22",
            Codegen=query[1],
            OutputFormat=sx.ResultFormat.root,  # type: ignore
            Delivery=("LocalCache" if download else "SignedURLs"),  # type: ignore
        ),
        Sample=[
            # TODO: Need a way to have the DID finder re-fetch the file list.
            sx.Sample(
                Name=f"speed_test_{ds_name}"[0:128],
                RucioDID=ds_name,
                Codegen=query[1],
                Query=query[0],
                NFiles=num_files,
                IgnoreLocalCache=ignore_cache,
            )  # type: ignore
            for ds_name in ds_names
        ],
    )

the fact you have to carry these two things along seperately isn't the test UX. Perhaps if all Querys impelment a common API, one could query for the codegen. No worries if codegen comes in via other routes, but this should be one of them.

@gordonwatts gordonwatts added enhancement New feature or request servicex Related to SX tests labels May 22, 2024
@gordonwatts gordonwatts added this to the Post Test milestone May 22, 2024
@ponyisi
Copy link
Collaborator

ponyisi commented Jul 18, 2024

Presumably fixed in the latest v3 frontend (where queries indicate their preferred codegens).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request servicex Related to SX tests
Projects
None yet
Development

No branches or pull requests

2 participants