Skip to content

Commit

Permalink
Update tests/unit_tests/udf_framework/test_query_handler_runner_udf_m…
Browse files Browse the repository at this point in the history
…ock.py

Co-authored-by: Nicola Coretti <[email protected]>
  • Loading branch information
ckunki and Nicoretti authored Oct 7, 2024
1 parent 789b03c commit f7698c5
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@
BUCKETFS_CONNECTION_NAME = "bucketfs_connection"


def to_json_str(**kwargs):
return json.dumps(kwargs)
def kwargs2dict(**kwargs):
return dict(kwargs)


def udf_mock_connection(user=None, password=None, **kwargs) -> Connection:
"""
For MountedBucket provide kwargs backend="mounted", and base_path.
"""
return Connection(
address=to_json_str(**kwargs),
user=to_json_str(username=user) if user else "{}",
password=to_json_str(password=password) if password else "{}",
address=json.dumps(kwargs2dict(**kwargs)),
user=json.dumps(kwargs2dict(username=user)) if user else "{}",
password=json.dumps(kwargs2dict(password=password)) if password else "{}",
)


Expand Down

0 comments on commit f7698c5

Please sign in to comment.