You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "ekaterinadimitrova2 (via GitHub)" <gi...@apache.org> on 2023/08/31 17:58:44 UTC

[GitHub] [cassandra] ekaterinadimitrova2 commented on a diff in pull request #2653: Cassandra 18787: Replace or remove obsolete functions and simplify cql_verison handling

ekaterinadimitrova2 commented on code in PR #2653:
URL: https://github.com/apache/cassandra/pull/2653#discussion_r1311841931


##########
pylib/cqlshlib/cqlshmain.py:
##########
@@ -277,22 +276,10 @@ def __repr__(self):
         return '<%s %s>' % (self.__class__.__name__, self.message())
 
 
-def maybe_ensure_text(val):
-    return str(val) if val else val
-
-
 class FormatError(DecodeError):
     verb = 'format'
 
 
-def full_cql_version(ver):
-    while ver.count('.') < 2:
-        ver += '.0'
-    ver_parts = ver.split('-', 1) + ['']
-    vertuple = tuple(list(map(int, ver_parts[0].split('.'))) + [ver_parts[1]])
-    return ver, vertuple

Review Comment:
   The old one was handling alpha beta versions; the new one will raise a ValueError if I read it correctly. 



##########
pylib/cqlshlib/cqlshmain.py:
##########
@@ -277,22 +276,10 @@ def __repr__(self):
         return '<%s %s>' % (self.__class__.__name__, self.message())
 
 
-def maybe_ensure_text(val):

Review Comment:
   Why was this check removed?



##########
pylib/cqlshlib/cqlshmain.py:
##########
@@ -2209,22 +2187,16 @@ def read_options(cmdlineargs, environment=os.environ):
         else:
             options.color = should_use_color()
 
-    if options.cqlversion is not None:
-        options.cqlversion, cqlvertup = full_cql_version(options.cqlversion)
-        if cqlvertup[0] < 3:
-            parser.error('%r is not a supported CQL version.' % options.cqlversion)

Review Comment:
   Why is this removed?



##########
pylib/cqlshlib/cqlshmain.py:
##########
@@ -2166,15 +2150,12 @@ def read_options(cmdlineargs, environment=os.environ):
         print("\nWarning: Using a password on the command line interface can be insecure."
               "\nRecommendation: use the credentials file to securely provide the password.\n", file=sys.stderr)
 
-    # Make sure some user values read from the command line are in unicode
-    options.execute = maybe_ensure_text(options.execute)

Review Comment:
   Same questions as before



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org