Skip to content

Python: Naming updates #12233

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

Conversation

eavanvalkenburg
Copy link
Member

Motivation and Context

This pull request introduces several updates across multiple files to standardize naming conventions, improve consistency in method calls, and modernize data model definitions. The primary changes include renaming key classes and methods, replacing deprecated fields with updated ones, and ensuring uniformity in collection management operations.

Standardization of Data Model Fields:

  • Replaced VectorStoreRecordDataField, VectorStoreRecordKeyField, and VectorStoreRecordVectorField with VectorStoreDataField, VectorStoreKeyField, and VectorStoreVectorField respectively across all relevant files. [1] [2] [3] [4] [5]
  • Updated data models in semantic_caching.py, store_chat_history_in_cosmosdb.py, and other files to use the new field types for consistency. [1] [2] [3]

Renaming and Refactoring Collection Management:

  • Renamed create_collection_if_not_exists to ensure_collection_exists and delete_collection to ensure_collection_deleted for clarity and consistency. [1] [2] [3]
  • Updated method calls in various files to reflect these changes. [1] [2]

Renaming Classes for Improved Clarity:

  • Renamed AzureCosmosDBNoSQLStore to CosmosNoSqlStore and AzureCosmosDBNoSQLCollection to CosmosNoSqlCollection. Similar updates were made to MongoDB-related classes. [1] [2]

Consistency in Record Type Definitions:

  • Replaced data_model_type with record_type in collection initialization across multiple files for uniformity. [1] [2] [3]

Miscellaneous Updates:

  • Consolidated imports for improved readability and maintainability. [1] [2]
  • Adjusted default values and annotations in data models to align with the updated field types. [1] [2]

These changes collectively enhance the maintainability and readability of the codebase while ensuring alignment with modern conventions.

Description

Closes: #11938

Contribution Checklist

@eavanvalkenburg eavanvalkenburg requested a review from a team as a code owner May 22, 2025 09:11
@markwallace-microsoft markwallace-microsoft added python Pull requests for the Python Semantic Kernel memory labels May 22, 2025
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented May 22, 2025

Python Unit Test Overview

Tests Skipped Failures Errors Time
3580 18 💤 0 ❌ 0 🔥 1m 49s ⏱️

@eavanvalkenburg eavanvalkenburg merged commit 35e69fc into microsoft:feature-python-vector-stores-preb May 23, 2025
19 checks passed
@eavanvalkenburg eavanvalkenburg deleted the naming_updates branch May 23, 2025 07:35
eavanvalkenburg added a commit that referenced this pull request May 26, 2025
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
This pull request introduces several updates across multiple files to
standardize naming conventions, improve consistency in method calls, and
modernize data model definitions. The primary changes include renaming
key classes and methods, replacing deprecated fields with updated ones,
and ensuring uniformity in collection management operations.

* Replaced `VectorStoreRecordDataField`, `VectorStoreRecordKeyField`,
and `VectorStoreRecordVectorField` with `VectorStoreDataField`,
`VectorStoreKeyField`, and `VectorStoreVectorField` respectively across
all relevant files.
[[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17R16-R19)
[[2]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL10-L18)
[[3]](diffhunk://#diff-af84e00363a79d8bd2f3b72976ecc95c0744fcdf89930ac9b058bfd27b27b83eL18-R18)
[[4]](diffhunk://#diff-c7a1b7cdeb95d9cdf398adc0cead91e30fcee1c6abff046f2933f0ac361d3982L30-R36)
[[5]](diffhunk://#diff-4c45e261749985abb60b9bd147b2bd2cb91fdfda869190da1f56c89032667eefL11-R14)
* Updated data models in `semantic_caching.py`,
`store_chat_history_in_cosmosdb.py`, and other files to use the new
field types for consistency.
[[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17L35-R37)
[[2]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL42-R44)
[[3]](diffhunk://#diff-af84e00363a79d8bd2f3b72976ecc95c0744fcdf89930ac9b058bfd27b27b83eL63-R80)

* Renamed `create_collection_if_not_exists` to
`ensure_collection_exists` and `delete_collection` to
`ensure_collection_deleted` for clarity and consistency.
[[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17L68-R68)
[[2]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL194-R194)
[[3]](diffhunk://#diff-3ad17b6faefe0a6ac2fff5b863169e5aac7ab99c49d4f376ba46f2d0d181b642L67-R67)
* Updated method calls in various files to reflect these changes.
[[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17L89-R89)
[[2]](diffhunk://#diff-c7a1b7cdeb95d9cdf398adc0cead91e30fcee1c6abff046f2933f0ac361d3982L150-R149)

* Renamed `AzureCosmosDBNoSQLStore` to `CosmosNoSqlStore` and
`AzureCosmosDBNoSQLCollection` to `CosmosNoSqlCollection`. Similar
updates were made to MongoDB-related classes.
[[1]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL178-R178)
[[2]](diffhunk://#diff-c7a1b7cdeb95d9cdf398adc0cead91e30fcee1c6abff046f2933f0ac361d3982L16-R18)

* Replaced `data_model_type` with `record_type` in collection
initialization across multiple files for uniformity.
[[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17L53-R53)
[[2]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL67-R69)
[[3]](diffhunk://#diff-c7a1b7cdeb95d9cdf398adc0cead91e30fcee1c6abff046f2933f0ac361d3982L99-R123)

* Consolidated imports for improved readability and maintainability.
[[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17R16-R19)
[[2]](diffhunk://#diff-af84e00363a79d8bd2f3b72976ecc95c0744fcdf89930ac9b058bfd27b27b83eL18-R18)
* Adjusted default values and annotations in data models to align with
the updated field types.
[[1]](diffhunk://#diff-4c45e261749985abb60b9bd147b2bd2cb91fdfda869190da1f56c89032667eefL47-R58)
[[2]](diffhunk://#diff-4c45e261749985abb60b9bd147b2bd2cb91fdfda869190da1f56c89032667eefL72-R71)

These changes collectively enhance the maintainability and readability
of the codebase while ensuring alignment with modern conventions.

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

Closes: #11938

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
eavanvalkenburg added a commit to eavanvalkenburg/semantic-kernel that referenced this pull request May 26, 2025
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
This pull request introduces several updates across multiple files to
standardize naming conventions, improve consistency in method calls, and
modernize data model definitions. The primary changes include renaming
key classes and methods, replacing deprecated fields with updated ones,
and ensuring uniformity in collection management operations.

* Replaced `VectorStoreRecordDataField`, `VectorStoreRecordKeyField`,
and `VectorStoreRecordVectorField` with `VectorStoreDataField`,
`VectorStoreKeyField`, and `VectorStoreVectorField` respectively across
all relevant files.
[[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17R16-R19)
[[2]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL10-L18)
[[3]](diffhunk://#diff-af84e00363a79d8bd2f3b72976ecc95c0744fcdf89930ac9b058bfd27b27b83eL18-R18)
[[4]](diffhunk://#diff-c7a1b7cdeb95d9cdf398adc0cead91e30fcee1c6abff046f2933f0ac361d3982L30-R36)
[[5]](diffhunk://#diff-4c45e261749985abb60b9bd147b2bd2cb91fdfda869190da1f56c89032667eefL11-R14)
* Updated data models in `semantic_caching.py`,
`store_chat_history_in_cosmosdb.py`, and other files to use the new
field types for consistency.
[[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17L35-R37)
[[2]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL42-R44)
[[3]](diffhunk://#diff-af84e00363a79d8bd2f3b72976ecc95c0744fcdf89930ac9b058bfd27b27b83eL63-R80)

* Renamed `create_collection_if_not_exists` to
`ensure_collection_exists` and `delete_collection` to
`ensure_collection_deleted` for clarity and consistency.
[[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17L68-R68)
[[2]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL194-R194)
[[3]](diffhunk://#diff-3ad17b6faefe0a6ac2fff5b863169e5aac7ab99c49d4f376ba46f2d0d181b642L67-R67)
* Updated method calls in various files to reflect these changes.
[[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17L89-R89)
[[2]](diffhunk://#diff-c7a1b7cdeb95d9cdf398adc0cead91e30fcee1c6abff046f2933f0ac361d3982L150-R149)

* Renamed `AzureCosmosDBNoSQLStore` to `CosmosNoSqlStore` and
`AzureCosmosDBNoSQLCollection` to `CosmosNoSqlCollection`. Similar
updates were made to MongoDB-related classes.
[[1]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL178-R178)
[[2]](diffhunk://#diff-c7a1b7cdeb95d9cdf398adc0cead91e30fcee1c6abff046f2933f0ac361d3982L16-R18)

* Replaced `data_model_type` with `record_type` in collection
initialization across multiple files for uniformity.
[[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17L53-R53)
[[2]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL67-R69)
[[3]](diffhunk://#diff-c7a1b7cdeb95d9cdf398adc0cead91e30fcee1c6abff046f2933f0ac361d3982L99-R123)

* Consolidated imports for improved readability and maintainability.
[[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17R16-R19)
[[2]](diffhunk://#diff-af84e00363a79d8bd2f3b72976ecc95c0744fcdf89930ac9b058bfd27b27b83eL18-R18)
* Adjusted default values and annotations in data models to align with
the updated field types.
[[1]](diffhunk://#diff-4c45e261749985abb60b9bd147b2bd2cb91fdfda869190da1f56c89032667eefL47-R58)
[[2]](diffhunk://#diff-4c45e261749985abb60b9bd147b2bd2cb91fdfda869190da1f56c89032667eefL72-R71)

These changes collectively enhance the maintainability and readability
of the codebase while ensuring alignment with modern conventions.

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

Closes: microsoft#11938

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
eavanvalkenburg added a commit to eavanvalkenburg/semantic-kernel that referenced this pull request May 26, 2025
<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
This pull request introduces several updates across multiple files to
standardize naming conventions, improve consistency in method calls, and
modernize data model definitions. The primary changes include renaming
key classes and methods, replacing deprecated fields with updated ones,
and ensuring uniformity in collection management operations.

* Replaced `VectorStoreRecordDataField`, `VectorStoreRecordKeyField`,
and `VectorStoreRecordVectorField` with `VectorStoreDataField`,
`VectorStoreKeyField`, and `VectorStoreVectorField` respectively across
all relevant files.
[[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17R16-R19)
[[2]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL10-L18)
[[3]](diffhunk://#diff-af84e00363a79d8bd2f3b72976ecc95c0744fcdf89930ac9b058bfd27b27b83eL18-R18)
[[4]](diffhunk://#diff-c7a1b7cdeb95d9cdf398adc0cead91e30fcee1c6abff046f2933f0ac361d3982L30-R36)
[[5]](diffhunk://#diff-4c45e261749985abb60b9bd147b2bd2cb91fdfda869190da1f56c89032667eefL11-R14)
* Updated data models in `semantic_caching.py`,
`store_chat_history_in_cosmosdb.py`, and other files to use the new
field types for consistency.
[[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17L35-R37)
[[2]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL42-R44)
[[3]](diffhunk://#diff-af84e00363a79d8bd2f3b72976ecc95c0744fcdf89930ac9b058bfd27b27b83eL63-R80)

* Renamed `create_collection_if_not_exists` to
`ensure_collection_exists` and `delete_collection` to
`ensure_collection_deleted` for clarity and consistency.
[[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17L68-R68)
[[2]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL194-R194)
[[3]](diffhunk://#diff-3ad17b6faefe0a6ac2fff5b863169e5aac7ab99c49d4f376ba46f2d0d181b642L67-R67)
* Updated method calls in various files to reflect these changes.
[[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17L89-R89)
[[2]](diffhunk://#diff-c7a1b7cdeb95d9cdf398adc0cead91e30fcee1c6abff046f2933f0ac361d3982L150-R149)

* Renamed `AzureCosmosDBNoSQLStore` to `CosmosNoSqlStore` and
`AzureCosmosDBNoSQLCollection` to `CosmosNoSqlCollection`. Similar
updates were made to MongoDB-related classes.
[[1]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL178-R178)
[[2]](diffhunk://#diff-c7a1b7cdeb95d9cdf398adc0cead91e30fcee1c6abff046f2933f0ac361d3982L16-R18)

* Replaced `data_model_type` with `record_type` in collection
initialization across multiple files for uniformity.
[[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17L53-R53)
[[2]](diffhunk://#diff-bff31c838fdfdb680d4dbdd3a24764dfd8a316b89b7d2ea466234edb98b68e9dL67-R69)
[[3]](diffhunk://#diff-c7a1b7cdeb95d9cdf398adc0cead91e30fcee1c6abff046f2933f0ac361d3982L99-R123)

* Consolidated imports for improved readability and maintainability.
[[1]](diffhunk://#diff-df5224582cd487ed94306045bd09dcd32ccbd9b3f82a63184d037ebe02d34b17R16-R19)
[[2]](diffhunk://#diff-af84e00363a79d8bd2f3b72976ecc95c0744fcdf89930ac9b058bfd27b27b83eL18-R18)
* Adjusted default values and annotations in data models to align with
the updated field types.
[[1]](diffhunk://#diff-4c45e261749985abb60b9bd147b2bd2cb91fdfda869190da1f56c89032667eefL47-R58)
[[2]](diffhunk://#diff-4c45e261749985abb60b9bd147b2bd2cb91fdfda869190da1f56c89032667eefL72-R71)

These changes collectively enhance the maintainability and readability
of the codebase while ensuring alignment with modern conventions.

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

Closes: microsoft#11938

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
memory python Pull requests for the Python Semantic Kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants