Skip to content

Override option for default consistency levels in cqlsh - #5066

Open
michaelsembwever wants to merge 1 commit into
apache:cassandra-5.0from
thelastpickle:mck/20626/5.0
Open

Override option for default consistency levels in cqlsh#5066
michaelsembwever wants to merge 1 commit into
apache:cassandra-5.0from
thelastpickle:mck/20626/5.0

Conversation

@michaelsembwever

Copy link
Copy Markdown
Member

Add the --consistency-level and --serial-consistency-level options, and the matching consistency_level and serial_consistency_level settings in the [cql] section of cqlshrc. The defaults stay ONE and SERIAL. cqlsh fails to start when either value is invalid.

Upstreamed from datastax/cassandra commit 87929f1

Add the --consistency-level and --serial-consistency-level options, and
the matching consistency_level and serial_consistency_level settings in
the [cql] section of cqlshrc. The defaults stay ONE and SERIAL. cqlsh
fails to start when either value is invalid.

Upstreamed from datastax/cassandra commit 87929f1

patch by Michael Semb Wever; reviewed by TBD for CASSANDRA-20626

Assisted-by: Claude Code:claude-opus-5
self.page_size = self.default_page_size
self.expand_enabled = expand_enabled

if not consistency_level:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Need to compare to None to make the exception correct, and also this will catch ConsistencyLevel.ANY which is numerically zero.

if not consistency_level:
raise Exception('Argument consistency_level must not be None')
if not serial_consistency_level:
raise Exception('Argument serial_consistency_level must not be None')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Misleading exception here too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants