Skip to content
Merged
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
4 changes: 2 additions & 2 deletions pinecone/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ def _preprocess_and_validate_config(self, config: dict) -> dict:
and raises ValueError in case an invalid value was specified.
"""
# general preprocessing and filtering
result = {k.strip(): v.strip() for k, v in config.items() if v is not None}
result = {k: v for k, v in result.items() if k in ConfigBase._fields}
# result = {k.strip(): v.strip() for k, v in config.items() if v is not None}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why comment out this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it throws an error, because v for openapi_config is of type OpenAPI "Configuration", which has no strip() method

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can fix this however you want

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, makes sense

result = {k: v for k, v in config.items() if k in ConfigBase._fields}
result.pop('environment', None)
# validate api key
api_key = result.get('api_key')
Expand Down