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

SNOW-781552: Add getter and setter methods to Session class #1

Open
7 tasks
sfc-gh-jfreeberg opened this issue Feb 7, 2023 · 3 comments
Open
7 tasks
Assignees
Labels
good first issue Good for newcomers python-parity Python SDK methods missing from Java/Scala

Comments

@sfc-gh-jfreeberg
Copy link
Collaborator

sfc-gh-jfreeberg commented Feb 7, 2023

Add the following methods to the Session class:

  • .getCurrentAccount() -> Optional<String>
  • .getCurrentWarehouse() -> Optional<String>
  • .getCurrentRole() -> Optional<String>

These methods can be used to change the db/role/warehouse at different stages of a job.

  • .setDatabase(database: string) -> void
  • .setRole(role: string) -> void
  • .setSchema(schema: string) -> void
  • .setWarehouse(warehouse: string) -> void

Each should return the string of the corresponding key. For reference, here is the implementation in the Python SDK: https://github.com/snowflakedb/snowpark-python/blob/main/src/snowflake/snowpark/session.py

@sfc-gh-jfreeberg sfc-gh-jfreeberg added the good first issue Good for newcomers label Feb 7, 2023
@sfc-gh-jfreeberg sfc-gh-jfreeberg changed the title Add getter methods to Session class Add getter and setter methods to Session class Feb 8, 2023
@sfc-gh-jfreeberg sfc-gh-jfreeberg added the python-parity Python SDK methods missing from Java/Scala label Feb 8, 2023
@sfc-gh-jfreeberg sfc-gh-jfreeberg closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2023
@github-actions github-actions bot changed the title Add getter and setter methods to Session class SNOW-781552: Add getter and setter methods to Session class Apr 6, 2023
@sbouhaddi
Copy link

Can i have a look at this one too?

@sbouhaddi
Copy link

You can assign this one also to me.
Thank you

@sbouhaddi
Copy link

sbouhaddi commented Dec 11, 2023

Hello ,
Do you mean something like this ?

Optional getCurrentAccount() {
var account = session.conn().getParameterValue("account", false, Option.empty());
return Optional.of(account);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers python-parity Python SDK methods missing from Java/Scala
Projects
None yet
Development

No branches or pull requests

2 participants