[ 
https://issues.apache.org/jira/browse/CASSPYTHON-29?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18107603#comment-18107603
 ] 

Bret McGuire commented on CASSPYTHON-29:
----------------------------------------

Yup, I think you have it right [~swsekar].  It's worth noting that adding a 
keyword arg to the StartupMessage constructor is the first thing that needs to 
be changed here.  That function is invoked within logic in cluster.py 
([here|https://github.com/apache/cassandra-python-driver/blob/3.30.1/cassandra/connection.py#L1410]
 specifically) which means we need a way to pass any additional options into 
these connections.  We'll almost certainly want to do this through the Cluster 
object so I'm guessing we'll need an additional arg there which will then pass 
all the way down to individual connections.

It's also worth considering how we handle cases in which we get duplicate (and 
perhaps even contradictory) inputs into the StartupMessage constructor.  We 
don't want to remove the existing parameters (so as to minimize breakage of 
existing code) but we need to be clear about what happens in a case such as:

```
msg = StartupMessage(compression="FOO", extra_options={"COMPRESSION","BAR"})
```

Finally, we'll want some decent tests to document the design decisions 
referenced above.

If you want to take a stab at this implementation [~swsekar] I'd encourage you 
to do so.  Otherwise just let me know and I can make it happen.  I've already 
added this ticket to the [4.0.0 planning 
doc|https://docs.google.com/document/d/1BLKmOatbF3rr4nUwssWy98bWGgzfQSPjbKM_G0LDd6w/edit?usp=sharing]
 so unless something goes astray it should be included in the next release.

> Allow user to specify arbitrary parameters for STARTUP message
> --------------------------------------------------------------
>
>                 Key: CASSPYTHON-29
>                 URL: https://issues.apache.org/jira/browse/CASSPYTHON-29
>             Project: Apache Cassandra Python driver
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Swathi Sekar
>            Assignee: Swathi Sekar
>            Priority: Normal
>
> *Summary*
> The driver should send the client's application name and version as 
> `APPLICATION_NAME` /
> `APPLICATION_VERSION` options in the STARTUP message.
> This brings the Python driver in line with the C++ driver (since 2.11.0, via
> `cass_cluster_set_application_name()` / 
> `cass_cluster_set_application_version()`) and the Java
> driver (since 4.4.0, via `SessionBuilder.withApplicationName` / 
> `withApplicationVersion`).
> *More info*
> `Cluster` already accepts `application_name`, `application_version` but they 
> are
> documented as Insights-only and are consumed solely by
> `cassandra/datastax/insights/reporter.py`. They are never sent over the 
> native protocol.
> This change would add them to the STARTUP options map.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to