You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/20 08:45:08 UTC
[GitHub] [airflow] tanelk opened a new issue, #23111: LocalFilesystemToS3Operator dest_key can not be a full s3:// style url
tanelk opened a new issue, #23111:
URL: https://github.com/apache/airflow/issues/23111
### Apache Airflow Provider(s)
amazon
### Versions of Apache Airflow Providers
apache-airflow-providers-amazon==3.3.0
apache-airflow-providers-ftp==2.1.2
apache-airflow-providers-http==2.1.2
apache-airflow-providers-imap==2.2.3
apache-airflow-providers-mongo==2.3.3
apache-airflow-providers-sqlite==2.1.3
### Apache Airflow version
2.3.0b1 (pre-release)
### Operating System
Arch Linux
### Deployment
Virtualenv installation
### Deployment details
_No response_
### What happened
`LocalFilesystemToS3Operator` does not accept full s3:// style url as `dest_key`, although it states, that it should:
```
:param dest_key: The key of the object to copy to. (templated)
It can be either full s3:// style url or relative path from root level.
When it's specified as a full s3:// url, including dest_bucket results in a TypeError.
```
### What you think should happen instead
`LocalFilesystemToS3Operator` should behave as documented.
### How to reproduce
A modification of an existing UT:
```
@mock_s3
def test_execute_with_only_key(self):
conn = boto3.client('s3')
conn.create_bucket(Bucket=self.dest_bucket)
operator = LocalFilesystemToS3Operator(
task_id='s3_to_file_sensor',
dag=self.dag,
filename=self.testfile1,
dest_key=f's3://dummy/{self.dest_key}',
**self._config,
)
operator.execute(None)
objects_in_dest_bucket = conn.list_objects(Bucket=self.dest_bucket, Prefix=self.dest_key)
# there should be object found, and there should only be one object found
assert len(objects_in_dest_bucket['Contents']) == 1
# the object found should be consistent with dest_key specified earlier
assert objects_in_dest_bucket['Contents'][0]['Key'] == self.dest_key
```
`FAILED tests/providers/amazon/aws/transfers/test_local_to_s3.py::TestFileToS3Operator::test_execute_with_only_key - TypeError: expected string or bytes-like object`
### Anything else
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] vincbeck commented on issue #23111: LocalFilesystemToS3Operator dest_key can not be a full s3:// style url
Posted by GitBox <gi...@apache.org>.
vincbeck commented on issue #23111:
URL: https://github.com/apache/airflow/issues/23111#issuecomment-1104113601
After investigation, it seems it is not the only S3 related operator with this bug. Thanks for catching this! Unless you want or are currently working on this, I can take care of fixing these operators
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk closed issue #23111: LocalFilesystemToS3Operator dest_key can not be a full s3:// style url
Posted by GitBox <gi...@apache.org>.
potiuk closed issue #23111: LocalFilesystemToS3Operator dest_key can not be a full s3:// style url
URL: https://github.com/apache/airflow/issues/23111
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] tanelk commented on issue #23111: LocalFilesystemToS3Operator dest_key can not be a full s3:// style url
Posted by GitBox <gi...@apache.org>.
tanelk commented on issue #23111:
URL: https://github.com/apache/airflow/issues/23111#issuecomment-1104121767
> After investigation, it seems it is not the only S3 related operator with this bug. Thanks for catching this! Unless you want or are currently working on this, I can take care of fixing these operators
Go ahead, I'm not working on this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on issue #23111: LocalFilesystemToS3Operator dest_key can not be a full s3:// style url
Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #23111:
URL: https://github.com/apache/airflow/issues/23111#issuecomment-1103922584
Would you like to fix it @denimalpaca ? Sounds like an easy fix and you can become one of > 2000 contriibutors to airflow. Actually fixing it is the fastest way to proceed, otherwise it will have to wait for someone willing to pick it up.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] tanelk commented on issue #23111: LocalFilesystemToS3Operator dest_key can not be a full s3:// style url
Posted by GitBox <gi...@apache.org>.
tanelk commented on issue #23111:
URL: https://github.com/apache/airflow/issues/23111#issuecomment-1103636418
@denimalpaca introduced this operator in #17382
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on issue #23111: LocalFilesystemToS3Operator dest_key can not be a full s3:// style url
Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #23111:
URL: https://github.com/apache/airflow/issues/23111#issuecomment-1103922920
@tanelk ^^
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org