Skip to content

Allow for counter columns be static. Fixed in C* 2.0.7 - #724

Closed
ubombi wants to merge 1 commit into
apache:masterfrom
ubombi:master
Closed

Allow for counter columns be static. Fixed in C* 2.0.7#724
ubombi wants to merge 1 commit into
apache:masterfrom
ubombi:master

Conversation

@ubombi

@ubombi ubombi commented Mar 29, 2017

Copy link
Copy Markdown
Contributor

CASSANDRA-6827 issue was resolver.
So we can enable static counters in ORM.

Tested manually on existing project.

@datastax-bot

Copy link
Copy Markdown

Hi @ubombi, thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes.

Sincerely,
DataStax Bot.

@ubombi ubombi changed the title Allow counter columns be static. Fixed in C* 2.0.7 Allow for counter columns be static. Fixed in C* 2.0.7 Mar 29, 2017
@datastax-bot

Copy link
Copy Markdown

Thank you @ubombi for signing the Contribution License Agreement.

Cheers,
DataStax Bot.

@mambocab

Copy link
Copy Markdown
Contributor

I mentioned it on IRC, but this should be a workaround for now:

from cassandra.cqlengine import columns
from cassandra.cqlengine.models import Model

class MyModel(Model):
    ...  # define PK, etc
    static_counter = columns.Counter()
    # The `static` attribute already exists, inherited from columns.Column
    static_counter.static = True

Please let me know if this doesn't work.

As-is, this PR adds an argument to columns.Counter.__init__, and it's not a keyword argument at end of the args, so it's a breaking API change that needs to wait until a major revision.

@mambocab

Copy link
Copy Markdown
Contributor

I'm closing this PR. We will probably address it for the next major (PYTHON-926), and we'll credit you in the Git history then.

@mambocab mambocab closed this Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants