Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,11 @@ def create_config(config:Optional[str]=None):

config_args.setdefault('max_pool_connections', DEFAULT_MAX_POOL_CONNECTIONS)

return Config(
retries={
'total_max_attempts': 1,
'mode': 'standard'
},
read_timeout=600,
user_agent_appid=f'graphrag-lexical-graph-{toolkit_version}',
**config_args
)
config_args.setdefault('read_timeout', 600)
config_args.setdefault('retries', {'total_max_attempts': 1, 'mode': 'standard'})
config_args.setdefault('user_agent_appid', f'graphrag-lexical-graph-{toolkit_version}')

return Config(**config_args)

def create_property_assigment_fn_for_neptune(key:str, value:Any) -> Callable[[str], str]:
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,27 @@ def test_user_agent_set(self):
cfg = create_config()
assert 'graphrag-lexical-graph' in cfg.user_agent_appid

@pytest.mark.parametrize(
"config_key, config_value, cfg_attr",
[
('read_timeout', 30, 'read_timeout'),
(
'retries',
{'total_max_attempts': 3, 'mode': 'adaptive'},
'retries',
),
('user_agent_appid', 'custom-app', 'user_agent_appid'),
],
)
def test_user_args_override_default_config_kwargs_without_type_error(
self,
config_key,
config_value,
cfg_attr,
):
cfg = create_config(_json.dumps({config_key: config_value}))
assert getattr(cfg, cfg_attr) == config_value


class TestCreatePropertyAssignmentFn:
def test_non_datetime_key_returns_identity(self):
Expand Down