Skip to content
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

Function/Class method naming should use lowercase with underscores #1864

Closed
Andrew-Chen-Wang opened this issue Jan 5, 2022 · 1 comment · Fixed by #1872
Closed

Function/Class method naming should use lowercase with underscores #1864

Andrew-Chen-Wang opened this issue Jan 5, 2022 · 1 comment · Fixed by #1872
Assignees
Labels
maintenance Maintenance (CI, Releases, etc)

Comments

@Andrew-Chen-Wang
Copy link
Contributor

Description: upon inspecting many of the new class methods, they don't follow Python convention. In addition to the PR for black and isort, I think the naming convention of these methods should be lowercase with underscores, for instance, _append_scores instead of _appendScores

@Andrew-Chen-Wang Andrew-Chen-Wang changed the title Class method naming should use lowercase with underscores Function/Class method naming should use lowercase with underscores Jan 5, 2022
@chayim
Copy link
Contributor

chayim commented Jan 10, 2022

@Andrew-Chen-Wang You're right. This comes as a direct result of the initial import of the module code into redis-py, and we should change that.

Reviewing, it appears that all of the associated functions are internal only, meaning this is not a breaking change.

@dvora-h Mind having a look? See below as an example of trying to identify these.

 grep -R -E 'def [_]{0,99}[a-z_]{1,}[A-Z]' redis/
redis/commands/bf/__init__.py:    def appendItems(params, items):
redis/commands/bf/__init__.py:    def appendError(params, error):
redis/commands/bf/__init__.py:    def appendCapacity(params, capacity):
redis/commands/bf/__init__.py:    def appendExpansion(params, expansion):
redis/commands/bf/__init__.py:    def appendNoScale(params, noScale):
redis/commands/bf/__init__.py:    def appendWeights(params, weights):
redis/commands/bf/__init__.py:    def appendNoCreate(params, noCreate):
redis/commands/bf/__init__.py:    def appendItemsAndIncrements(params, items, increments):
redis/commands/bf/__init__.py:    def appendValuesAndWeights(params, items, weights):
redis/commands/bf/__init__.py:    def appendMaxIterations(params, max_iterations):
redis/commands/bf/__init__.py:    def appendBucketSize(params, bucket_size):
redis/commands/search/commands.py:    def _get_AggregateResult(self, raw, query, has_cursor):
redis/commands/search/indexDefinition.py:    def _appendIndexType(self, index_type):
redis/commands/search/indexDefinition.py:    def _appendPrefix(self, prefix):
redis/commands/search/indexDefinition.py:    def _appendFilter(self, filter):
redis/commands/search/indexDefinition.py:    def _appendLanguage(self, language_field, language):
redis/commands/search/indexDefinition.py:    def _appendScore(self, score_field, score):
redis/commands/search/indexDefinition.py:    def _appendPayload(self, payload_field):
redis/commands/json/path.py:    def rootPath():
redis/commands/timeseries/commands.py:    def _appendUncompressed(params, uncompressed):
redis/commands/timeseries/commands.py:    def _appendWithLabels(params, with_labels, select_labels=None):
redis/commands/timeseries/commands.py:    def _appendGroupbyReduce(params, groupby, reduce):
redis/commands/timeseries/commands.py:    def _appendRetention(params, retention):
redis/commands/timeseries/commands.py:    def _appendLabels(params, labels):
redis/commands/timeseries/commands.py:    def _appendCount(params, count):
redis/commands/timeseries/commands.py:    def _appendTimestamp(params, timestamp):
redis/commands/timeseries/commands.py:    def _appendAlign(params, align):
redis/commands/timeseries/commands.py:    def _appendAggregation(params, aggregation_type, bucket_size_msec):
redis/commands/timeseries/commands.py:    def _appendChunkSize(params, chunk_size):
redis/commands/timeseries/commands.py:    def _appendDuplicatePolicy(params, command, duplicate_policy):
redis/commands/timeseries/commands.py:    def _appendFilerByTs(params, ts_list):
redis/commands/timeseries/commands.py:    def _appendFilerByValue(params, min_value, max_value):
redis/commands/helpers.py:def decodeDictKeys(obj):
redis/commands/graph/node.py:    def toString(self):
redis/commands/graph/__init__.py:    def relationshipTypes(self):
redis/commands/graph/__init__.py:    def propertyKeys(self):
redis/commands/graph/edge.py:    def toString(self):

@chayim chayim added the maintenance Maintenance (CI, Releases, etc) label Jan 10, 2022
@dvora-h dvora-h mentioned this issue Jan 11, 2022
5 tasks
dssecret pushed a commit to Tornium/tornium that referenced this issue Apr 1, 2022
Signed-off-by: dssecret <webmaster.deeksh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Maintenance (CI, Releases, etc)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants