You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Lee-W (via GitHub)" <gi...@apache.org> on 2024/04/29 15:32:23 UTC

[PR] add missing conn_id to string representation of ObjectStoragePath [airflow]

Lee-W opened a new pull request, #39313:
URL: https://github.com/apache/airflow/pull/39313

   As stated in [apache-airflow-providers-common-io - Object Storage XCom Backend](https://airflow.apache.org/docs/apache-airflow-providers-common-io/stable/xcom_backend.html), we'll need to set `xcom_objectstorage_path` to something like `s3://conn_id@mybucket/key` to use customized xcom backend. As the string representation of `ObjectStoragePath` does not contain `conn_id`, [this serialization](https://github.com/apache/airflow/blob/6112745b8f2ac7b0eeaf909a9f3209ff2819cc8b/airflow/providers/common/io/xcom/backend.py#L148) will lost this information which cause [this comparison](https://github.com/apache/airflow/blob/6112745b8f2ac7b0eeaf909a9f3209ff2819cc8b/airflow/providers/common/io/xcom/backend.py#L110) to fail.
   
   
   <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
   
      http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
    -->
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   
   
   <!-- Please keep an empty line above the dashes. -->
   ---
   **^ Add meaningful description above**
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
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


Re: [PR] add missing conn_id to string representation of ObjectStoragePath [airflow]

Posted by "simi (via GitHub)" <gi...@apache.org>.
simi commented on PR #39313:
URL: https://github.com/apache/airflow/pull/39313#issuecomment-3145313455

   I'll open PR to fix. I can confirm `conn_id` is serialized properly outside the URI.
   
   <img width="2160" height="669" alt="image" src="https://github.com/user-attachments/assets/2579d323-4ff8-4133-a852-d1c799d3aa05" />
   


-- 
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


Re: [PR] add missing conn_id to string representation of ObjectStoragePath [airflow]

Posted by "simi (via GitHub)" <gi...@apache.org>.
simi commented on PR #39313:
URL: https://github.com/apache/airflow/pull/39313#issuecomment-3145186252

   Hello @Lee-W, this seems to broke ability to use `ObjectStoragePath` directly with DuckDB and similar as explained at https://airflow.apache.org/docs/apache-airflow/stable/tutorial/objectstorage.html#analyzing-the-data-with-duckdb since including the `conn_id` makes invalid bucket name. Is it still needed since there are `serialize`/`deserialize` methods implemented for XCom?


-- 
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


Re: [PR] add missing conn_id to string representation of ObjectStoragePath [airflow]

Posted by "TJaniF (via GitHub)" <gi...@apache.org>.
TJaniF commented on PR #39313:
URL: https://github.com/apache/airflow/pull/39313#issuecomment-2109805719

   > This is Airflow core not providers. It depends when @ephraimbuddy will cut Airflow 2.9.2
   
   Oh! Apologies 🤦 . Thank you!


-- 
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


Re: [PR] add missing conn_id to string representation of ObjectStoragePath [airflow]

Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on PR #39313:
URL: https://github.com/apache/airflow/pull/39313#issuecomment-2109243198

   > Hello @eladkal 🙂
   > 
   > Very sorry for the late poke about this but is there a chance to include a 1.3.2 release of the common io provider with this bugfix in the current wave of releases (or the next one, since the May 12th one already two votes)? That would be awesome, as soon as this bugfix is in, I can get a tutorial about using the Object Storage XCom backend in the Astronomer docs merged 🙂.
   > 
   > cc: @pankajkoti
   
   This is Airflow core not providers.
   It depends when @ephraimbuddy will cut Airflow 2.9.2


-- 
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


Re: [PR] add missing conn_id to string representation of ObjectStoragePath [airflow]

Posted by "pankajastro (via GitHub)" <gi...@apache.org>.
pankajastro commented on code in PR #39313:
URL: https://github.com/apache/airflow/pull/39313#discussion_r1583298532


##########
tests/io/test_path.py:
##########
@@ -347,6 +347,7 @@ def test_serde_store(self):
         s = store.serialize()
         d = ObjectStore.deserialize(s, 1)
 
+        # test

Review Comment:
   ```suggestion
   ```



-- 
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


Re: [PR] add missing conn_id to string representation of ObjectStoragePath [airflow]

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W merged PR #39313:
URL: https://github.com/apache/airflow/pull/39313


-- 
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


Re: [PR] add missing conn_id to string representation of ObjectStoragePath [airflow]

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #39313:
URL: https://github.com/apache/airflow/pull/39313#issuecomment-2109151480

   > Hello @eladkal 🙂
   > 
   > Very sorry for the late poke about this but is there a chance to include a 1.3.2 release of the common io provider with this bugfix in the current wave of releases (or the next one, since the May 12th one already two votes)? That would be awesome, as soon as this bugfix is in, I can get a tutorial about using the Object Storage XCom backend in the Astronomer docs merged 🙂.
   > 
   > cc: @pankajkoti
   
   If I'm not mistaken, we'll need to wait for the next airflow release to include this fix


-- 
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


Re: [PR] add missing conn_id to string representation of ObjectStoragePath [airflow]

Posted by "TJaniF (via GitHub)" <gi...@apache.org>.
TJaniF commented on PR #39313:
URL: https://github.com/apache/airflow/pull/39313#issuecomment-2107515331

   Hello @eladkal 🙂 
   
   Very sorry for the late poke about this but is there a chance to include a 1.3.2 release of the common io provider with this bugfix in the current wave of releases (or the next one, since the May 12th one already two votes)?
   That would be awesome, as soon as this bugfix is in, I can get a tutorial about using the Object Storage XCom backend merged 🙂. 
   
   cc: @pankajkoti 


-- 
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


Re: [PR] add missing conn_id to string representation of ObjectStoragePath [airflow]

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #39313:
URL: https://github.com/apache/airflow/pull/39313#issuecomment-3146444695

   yep, it's possible the implementation has changed since 2 to 3. Feel free to send a PR 🙂 Thanks


-- 
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