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

Pass use_env_token to to_s3_csv #822

Merged
merged 3 commits into from
May 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions parsons/etl/tofrom.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ def to_s3_csv(
acl="bucket-owner-full-control",
public_url=False,
public_url_expires=3600,
use_env_token=True,
**csvargs,
):
"""
Expand Down Expand Up @@ -429,6 +430,10 @@ def to_s3_csv(
The time, in seconds, until the url expires if ``public_url`` set to ``True``.
acl: str
The S3 permissions on the file
use_env_token: boolean
Controls use of the ``AWS_SESSION_TOKEN`` environment variable for S3. Defaults
to ``True``. Set to ``False`` in order to ignore the ``AWS_SESSION_TOKEN`` env
variable even if the ``aws_session_token`` argument was not passed in.
\**csvargs: kwargs
``csv_writer`` optional arguments
`Returns:`
Expand All @@ -455,6 +460,7 @@ def to_s3_csv(
self.s3 = S3(
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key,
use_env_token=use_env_token,
)
self.s3.put_file(bucket, key, local_path, acl=acl)

Expand Down