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

Parameterized Querying and Optional Progress Logging from the GraphProjectRemoteRunner #802

Open
angelosantos4 opened this issue Dec 11, 2024 · 0 comments

Comments

@angelosantos4
Copy link

Is your feature request related to a problem? Please describe.

I am unable to find a way to parameterize queries that are passed into the remote projection function. It seems like the suggested endpoint for remote projection requires that the query passed in is explicitly in the string format. I would also like the progress logging provided to be optional. It really messes with our json logger in production.

Describe the solution you would like

I would like parameters to be exposed in the GraphProjectRemoteRunner call procedure. I believe something like:

class GraphProjectRemoteRunner(IllegalAttrChecker):
    @compatible_with("project", min_inclusive=ServerVersion(2, 7, 0))
    def __call__(
            self,
            graph_name: str,
            query: str | Query, # <-- Query object that unpacks parameterized values. 
            job_id: Optional[str] = None,
            concurrency: int = 4,
            undirected_relationship_types: Optional[list[str]] = None,
            inverse_indexed_relationship_types: Optional[list[str]] = None,
            batch_size: Optional[int] = None,
            logProgress: bool = True
        ) 

Alternatively:

class GraphProjectRemoteRunner(IllegalAttrChecker):
    @compatible_with("project", min_inclusive=ServerVersion(2, 7, 0))
    def __call__(
            self,
            graph_name: str,
            query: str,
            job_id: Optional[str] = None,
            concurrency: int = 4,
            undirected_relationship_types: Optional[list[str]] = None,
            inverse_indexed_relationship_types: Optional[list[str]] = None,
            batch_size: Optional[int] = None,
            logProgress: bool = True,
            **kwargs # or something called params. 
        ) 

It seems like the remote projection api may just be behind other api's for projection in the client library, those api's currently have this feature.

Describe alternatives you have considered
Suppose I have a list or a dictionary I would like to pass as parameters to the query. Right now I have to format a string to incorperate these values into the string with an awful str(dict).replace(""", "") (Wouldn't even work for Dict[str, str] ), and str(list).replace("", '').

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant