-
Notifications
You must be signed in to change notification settings - Fork 68
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
Python code cleanup #2573
Python code cleanup #2573
Conversation
Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>
Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>
Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>
Signed-off-by: Prateek Kumar <prateek.kumar@improving.com>
schema (List[Field]): Fields to populate into the index. Equivalent to `SCHEMA` block in the module API. | ||
options (Optional[FtCreateOptions]): Optional arguments for the FT.CREATE command. See `FtCreateOptions`. | ||
options (Optional[FtCreateOptions]): Optional arguments for the FT.CREATE command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you remove the see?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of python, unlike JAVA and Node, this statement does not link to the actual class and is therefore not adding any extra value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to find a python doc validator and generator. This will define doc format and then we can restore all see
to ensure links are properly rendered in HTML docs.
""" | ||
args = super().toArgs() | ||
def to_args(self) -> List[TEncodable]: | ||
args = super().to_args() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why removing docs?
You can change to dev docs and leave something simple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an inherited class, and the doc from the main abstract class for this method is available when we hover over the method in IDE. This is the feedback I got when I discussed with others about this.
This was first mentioned in this PR comment: https://github.com/valkey-io/valkey-glide/pull/2530/files#r1819482800
I can change this back, if you think for some reason we need this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the docs in the abstract are sufficient, no need
+ ' incline! They may be at the age when a 27.5\\" wheel bike is just too clumsy' | ||
+ ' coming off a 24\\" bike. The Hillcraft 26 is just the solution they need!",' | ||
+ ' "condition": "used"}', | ||
'{"brand": "Bicyk", "model": "Hillcraft", "price": 1200, "condition": "used"}', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upon review of the code across all languages, I found this has already been removed from the JAVA integ tests, I want to keep everything consistent across languages.
The reason for removal from JAVA: It is a JSON key that is not used for anything during testing and is adding no value by keeping it in the record.
The issue doesn't mention the reasoning for this PR, can you elaborate on the goal and actions? |
Lazy blueprint for elaborating, you can edit with the real details: This pull request focuses on code cleanup and consistency improvements in the Python codebase, specifically for the Code Cleanup and Consistency Improvements:
|
I have updated the details in the PR description. I will follow this format of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
We are freezing merges until CI is green again, then ill approve
Thanks!
Issue link
This Pull Request is linked to issue (URL): #2429
PR description
This is a follow up PR based on a thorough review of the Python VSS module code to improve the code quality of the final code sent into the release. It includes the following changes:
Documentation fixes, test case refactoring and adding binary tests.
Files removed:
python/python/tests/tests_server_modules/search/test_ft_create.py
,python/python/tests/tests_server_modules/search/test_ft_search.py
,python/python/tests/tests_server_modules/search/test_ft_dropindex.py
All tests moved to
python/python/tests/tests_server_modules/test_ft.py
FtCreateOptions
. This is not required here because unlike JAVA it does not link to anything. It is redundant code because the class name is present in params section the documentation and this is self explanatory.FT.EXPLAIN
andFT.EXPLAINCLI
commands added #2508Typo fixes, variable names consistency fixes, function name consistency fixes:
FtSeachOptions
. Corrected the typo in the import statement and throughout the code by changingFtSeachOptions
toFtSearchOptions
inpython/python/glide/__init__.py
andpython/python/glide/async_commands/server_modules/ft.py
[1] [2] [3] [4].toArgs()
toto_args()
. This is already done forFT.AGGREGATE
. Fix for others. Updated method names from toArgs to to_args for consistency inpython/python/glide/async_commands/server_modules/ft_options/ft_create_options.py
[1] [2] [3] [4] [5] [6].FtSeachKeywords
toFtSearchKeywords
inpython/python/glide/async_commands/server_modules/ft_options/ft_constants.py
.CHANGELOG.md
.Checklist
Before submitting the PR make sure the following are checked: