Skip to content

validate_path funct returns None #1364

Description

@mail4umar

Discussed in #1359

Originally posted by pafechet November 28, 2025
The new function validate_path takes a path as urgument but returns None. This function only raises an error if the path is incorrect.

It is used when the connection is set using VERTICAPY_CONNECTION env variable .
Here the validated_path became None which lead to an error.

I believe we can simply add a return value to validate_path func, if all the tests are ok, then return the path parameter.

Here a stack trace showing the error when I try to list all available connections.

Type "help", "copyright", "credits" or "license" for more information.
>>> from verticapy import available_connections
>>> available_connections()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/conda/envs/custom/env/lib/python3.11/site-packages/verticapy/connection/read.py", line 57, in available_connections
    confparser = get_confparser()
                 ^^^^^^^^^^^^^^^^
  File "/usr/conda/envs/custom/env/lib/python3.11/site-packages/verticapy/connection/utils.py", line 58, in get_confparser
    confparser.read(dsn)
  File "/usr/conda/envs/custom/env/lib/python3.11/configparser.py", line 710, in read
    for filename in filenames:
TypeError: 'NoneType' object is not iterable

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions