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

write_cassandra block #124 #215

Merged
merged 9 commits into from
Dec 19, 2022
Merged

write_cassandra block #124 #215

merged 9 commits into from
Dec 19, 2022

Conversation

spicy-sauce
Copy link
Member

No description provided.

@spicy-sauce spicy-sauce requested a review from zalmane December 18, 2022 15:18
async def run(self, data: List[Dict[str, Any]]) -> Tuple[List[Dict[str, Any]], List[Result]]:
logger.debug(f"Running {self.get_block_name()}")

data = write_utils.write_records(data, self.opcode_field, self.execute_upsert, self.execute_delete)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume we need to open a 'transaction' here? is there such a concept in cassandra?

Copy link
Member Author

Choose a reason for hiding this comment

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

return utils.produce_data_and_results(data)

def get_future(self, stmt: PreparedStatement, record: Dict[str, Any]) -> Any:
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need a method for 2 lines if this is only called in one place? may be more maintainable to just inline

Copy link
Member Author

Choose a reason for hiding this comment

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

It's called from two places.

@zalmane zalmane merged commit 7a76378 into main Dec 19, 2022
@zalmane zalmane deleted the 124-write-cassandra-block branch December 19, 2022 15:22
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