question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ignoring unsupported keyword arguments for client and ExtraArgs

See original GitHub issue

Problem description

Be sure your description clearly answers the following questions:

  • What are you trying to achieve? Using the smart_open.open function I am trying to pass the client and ExtraArgs keywords allowed in Boto3 to my stream to an S3 bucket. boto3 upload docs
  • What is the expected result? My expectation is that the data will be added to the s3 bucket without any warnings and that the ExtraArgs will be applied
  • What are you seeing instead? What I am seeing instead is that while the data is still being uploaded to the s3 bucket it: 1. Kicks back a warnings re: client and ExtraArgs keywords 2. Doesn’t apply the ExtraArgs to the dataset on s3

Steps/code to reproduce the problem

In order for us to be able to solve your problem, we have to be able to reproduce it on our end. Without reproducing the problem, it is unlikely that we’ll be able to help you.

input


s3_client = boto3.client("s3")
extra_args = {'ContentType': 'text/csv'}
file_path = smart_open.open(("s3://" + bucket + "/" + key), 'w', newline="",
                                        transport_params=dict(client=s3_client, ExtraArgs=extra_args))

file = io.StringIO()
with file_path as file_out:
    writer = DictWriter(file)
    writer.writeheader()
    file_out.write(file.getvalue())

output

WARNING - ignoring unsupported keyword arguments: ['ExtraArgs', 'client']

Include full tracebacks, logs and datasets if necessary. Please keep the examples minimal (minimal reproducible example).

Versions

Please provide the output of:

import platform, sys, smart_open
print(platform.platform())
print("Python", sys.version)
print("smart_open", smart_open.__version__)
Windows-10-10.0.19041-SP0
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)]
smart_open 4.2.0

Checklist

Before you create the issue, please make sure you have:

  • Described the problem clearly
  • Provided a minimal reproducible example, including any required data
  • Provided the version numbers of the relevant software

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
patrickleclair-GORDONFNcommented, Mar 30, 2021

Thanks for all of your help. I was able to pass the parameters and have it run without warnings now.

0reactions
mpenkovcommented, Mar 30, 2021

OK, I’ve worked out what the problem is. First and foremost, the docs were for an unreleased developer version, and you had 4.2.0 installed. I’ve since released 5.0.0 - if you install that, the behavior should be more like what you expected.

Second, you’re passing the Content-Type parameter (and other parameters) incorrectly. You need to do something like this:

transport_params = {
  'client_kwargs': {
     'S3.Client.put_object': {
       'Content-Encoding': ...,
     },
  },
}

See the docs for more examples.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ignoring unsupported keyword arguments for client and ...
Using the smart_open.open function I am trying to pass the client and ExtraArgs keywords allowed in Boto3 to my stream to an S3...
Read more >
What does "wrap" in np.pad actually do? - Stack Overflow
Pads with the wrap of the vector along the axis. The first values are used to pad the end and the end values...
Read more >
blessed.terminal — Blessed 1.9.4 documentation
UnsupportedOperation `` in Python 2.5""" try: _ = InterruptedError del _ except ... is and saves sticking lots of extra args on client...
Read more >
User Manual - rust-analyzer
Run specified cargo check command for diagnostics on save. rust-analyzer.checkOnSave.extraArgs (default: [] ). Extra arguments for cargo check ...
Read more >
API Reference — Airflow Documentation
For standard SQL queries, this flag is ignored and results are never ... Another way to accomplish the same thing is to use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found