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 2020/01/12 15:45:52 UTC

[GitHub] [airflow] mik-laj opened a new pull request #7145: [AIRFLOW-6543][AIP-21] Promotion of contrib classes to the core

mik-laj opened a new pull request #7145: [AIRFLOW-6543][AIP-21] Promotion of contrib classes to the core
URL: https://github.com/apache/airflow/pull/7145
 
 
   More information: https://cwiki.apache.org/confluence/display/AIRFLOW/AIP-21%3A+Changes+in+import+paths
   https://docs.google.com/spreadsheets/d/1Z5jqsGz9QjmVDQAeI6NK8Aa-v6SQv8jfV8QzIZ4-q4w/edit#gid=0
   
   ---
   Issue link: WILL BE INSERTED BY [boring-cyborg](https://github.com/kaxil/boring-cyborg)
   
   - [X] Description above provides context of the change
   - [X] Commit message/PR title starts with `[AIRFLOW-NNNN]`. AIRFLOW-NNNN = JIRA ID<sup>*</sup>
   - [X] Unit tests coverage for changes (not needed for documentation changes)
   - [X] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
   - [X] Relevant documentation is updated including usage instructions.
   - [X] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example).
   
   <sup>*</sup> For document-only changes commit message can start with `[AIRFLOW-XXXX]`.
   
   ---
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+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 [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [airflow] mik-laj commented on a change in pull request #7145: [AIRFLOW-6543][AIP-21] Promotion of contrib classes to the core

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #7145: [AIRFLOW-6543][AIP-21] Promotion of contrib classes to the core
URL: https://github.com/apache/airflow/pull/7145#discussion_r365965073
 
 

 ##########
 File path: airflow/contrib/sensors/file_sensor.py
 ##########
 @@ -16,54 +16,14 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-#
-
-import os
-from glob import glob
-
-from airflow.contrib.hooks.fs_hook import FSHook
-from airflow.sensors.base_sensor_operator import BaseSensorOperator
-from airflow.utils.decorators import apply_defaults
-
-
-class FileSensor(BaseSensorOperator):
-    """
-    Waits for a file or folder to land in a filesystem.
-
-    If the path given is a directory then this sensor will only return true if
-    any files exist inside it (either directly, or within a subdirectory)
-
-    :param fs_conn_id: reference to the File (path)
-        connection id
-    :type fs_conn_id: str
-    :param filepath: File or folder name (relative to
-        the base path set within the connection), can be a glob.
-    :type fs_conn_id: str
-    """
-    template_fields = ('filepath',)
-    ui_color = '#91818a'
-
-    @apply_defaults
-    def __init__(self,
-                 filepath,
-                 fs_conn_id='fs_default',
-                 *args,
-                 **kwargs):
-        super().__init__(*args, **kwargs)
-        self.filepath = filepath
-        self.fs_conn_id = fs_conn_id
+"""This module is deprecated. Please use `airflow.sensors.fs`."""
 
 Review comment:
   Ok. I will prepare PR.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [airflow] nuclearpinguin commented on a change in pull request #7145: [AIRFLOW-6543][AIP-21] Promotion of contrib classes to the core

Posted by GitBox <gi...@apache.org>.
nuclearpinguin commented on a change in pull request #7145: [AIRFLOW-6543][AIP-21] Promotion of contrib classes to the core
URL: https://github.com/apache/airflow/pull/7145#discussion_r365594050
 
 

 ##########
 File path: airflow/contrib/sensors/file_sensor.py
 ##########
 @@ -16,54 +16,14 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-#
-
-import os
-from glob import glob
-
-from airflow.contrib.hooks.fs_hook import FSHook
-from airflow.sensors.base_sensor_operator import BaseSensorOperator
-from airflow.utils.decorators import apply_defaults
-
-
-class FileSensor(BaseSensorOperator):
-    """
-    Waits for a file or folder to land in a filesystem.
-
-    If the path given is a directory then this sensor will only return true if
-    any files exist inside it (either directly, or within a subdirectory)
-
-    :param fs_conn_id: reference to the File (path)
-        connection id
-    :type fs_conn_id: str
-    :param filepath: File or folder name (relative to
-        the base path set within the connection), can be a glob.
-    :type fs_conn_id: str
-    """
-    template_fields = ('filepath',)
-    ui_color = '#91818a'
-
-    @apply_defaults
-    def __init__(self,
-                 filepath,
-                 fs_conn_id='fs_default',
-                 *args,
-                 **kwargs):
-        super().__init__(*args, **kwargs)
-        self.filepath = filepath
-        self.fs_conn_id = fs_conn_id
+"""This module is deprecated. Please use `airflow.sensors.fs`."""
 
 Review comment:
   I am not sure if `fs` is a meaningful name, it's rather ambiguous.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [airflow] mik-laj merged pull request #7145: [AIRFLOW-6543][AIP-21] Promotion of contrib classes to the core

Posted by GitBox <gi...@apache.org>.
mik-laj merged pull request #7145: [AIRFLOW-6543][AIP-21] Promotion of contrib classes to the core
URL: https://github.com/apache/airflow/pull/7145
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [airflow] potiuk commented on a change in pull request #7145: [AIRFLOW-6543][AIP-21] Promotion of contrib classes to the core

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #7145: [AIRFLOW-6543][AIP-21] Promotion of contrib classes to the core
URL: https://github.com/apache/airflow/pull/7145#discussion_r365603475
 
 

 ##########
 File path: airflow/contrib/sensors/file_sensor.py
 ##########
 @@ -16,54 +16,14 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-#
-
-import os
-from glob import glob
-
-from airflow.contrib.hooks.fs_hook import FSHook
-from airflow.sensors.base_sensor_operator import BaseSensorOperator
-from airflow.utils.decorators import apply_defaults
-
-
-class FileSensor(BaseSensorOperator):
-    """
-    Waits for a file or folder to land in a filesystem.
-
-    If the path given is a directory then this sensor will only return true if
-    any files exist inside it (either directly, or within a subdirectory)
-
-    :param fs_conn_id: reference to the File (path)
-        connection id
-    :type fs_conn_id: str
-    :param filepath: File or folder name (relative to
-        the base path set within the connection), can be a glob.
-    :type fs_conn_id: str
-    """
-    template_fields = ('filepath',)
-    ui_color = '#91818a'
-
-    @apply_defaults
-    def __init__(self,
-                 filepath,
-                 fs_conn_id='fs_default',
-                 *args,
-                 **kwargs):
-        super().__init__(*args, **kwargs)
-        self.filepath = filepath
-        self.fs_conn_id = fs_conn_id
+"""This module is deprecated. Please use `airflow.sensors.fs`."""
 
 Review comment:
   I agree `fs` is rather ambiguous. I missed that one when I looked at the spreadsheet. I would rather change it to `filesystem`. I don't think we need to discuss it in devlist if we agree during the PR that it's a better name. That's actually name that is still in the AIP-21 (thought it was in providers originally).
   
   WDYT?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [airflow] potiuk commented on a change in pull request #7145: [AIRFLOW-6543][AIP-21] Promotion of contrib classes to the core

Posted by GitBox <gi...@apache.org>.
potiuk commented on a change in pull request #7145: [AIRFLOW-6543][AIP-21] Promotion of contrib classes to the core
URL: https://github.com/apache/airflow/pull/7145#discussion_r365603475
 
 

 ##########
 File path: airflow/contrib/sensors/file_sensor.py
 ##########
 @@ -16,54 +16,14 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-#
-
-import os
-from glob import glob
-
-from airflow.contrib.hooks.fs_hook import FSHook
-from airflow.sensors.base_sensor_operator import BaseSensorOperator
-from airflow.utils.decorators import apply_defaults
-
-
-class FileSensor(BaseSensorOperator):
-    """
-    Waits for a file or folder to land in a filesystem.
-
-    If the path given is a directory then this sensor will only return true if
-    any files exist inside it (either directly, or within a subdirectory)
-
-    :param fs_conn_id: reference to the File (path)
-        connection id
-    :type fs_conn_id: str
-    :param filepath: File or folder name (relative to
-        the base path set within the connection), can be a glob.
-    :type fs_conn_id: str
-    """
-    template_fields = ('filepath',)
-    ui_color = '#91818a'
-
-    @apply_defaults
-    def __init__(self,
-                 filepath,
-                 fs_conn_id='fs_default',
-                 *args,
-                 **kwargs):
-        super().__init__(*args, **kwargs)
-        self.filepath = filepath
-        self.fs_conn_id = fs_conn_id
+"""This module is deprecated. Please use `airflow.sensors.fs`."""
 
 Review comment:
   I agree `fs` is rather ambiguous. I missed that one when I looked at the spreadsheet. I would rather change it to filesystem. I don't think we need to discuss it in devlist if we agree during the PR that it's a better name. That's actually name that is still in the AIP-21 (thought it was in providers originally).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [airflow] codecov-io commented on issue #7145: [AIRFLOW-6543][AIP-21] Promotion of contrib classes to the core

Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #7145: [AIRFLOW-6543][AIP-21] Promotion of contrib classes to the core
URL: https://github.com/apache/airflow/pull/7145#issuecomment-573937969
 
 
   # [Codecov](https://codecov.io/gh/apache/airflow/pull/7145?src=pr&el=h1) Report
   > Merging [#7145](https://codecov.io/gh/apache/airflow/pull/7145?src=pr&el=desc) into [master](https://codecov.io/gh/apache/airflow/commit/6df30a3ee78605e00376b3d2a0a537e27a6f20a9?src=pr&el=desc) will **increase** coverage by `<.01%`.
   > The diff coverage is `97.22%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/airflow/pull/7145/graphs/tree.svg?width=650&token=WdLKlKHOAU&height=150&src=pr)](https://codecov.io/gh/apache/airflow/pull/7145?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #7145      +/-   ##
   ==========================================
   + Coverage   85.43%   85.43%   +<.01%     
   ==========================================
     Files         707      710       +3     
     Lines       39361    39373      +12     
   ==========================================
   + Hits        33627    33639      +12     
     Misses       5734     5734
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/airflow/pull/7145?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [airflow/sensors/filesystem.py](https://codecov.io/gh/apache/airflow/pull/7145/diff?src=pr&el=tree#diff-YWlyZmxvdy9zZW5zb3JzL2ZpbGVzeXN0ZW0ucHk=) | `100% <100%> (ø)` | |
   | [airflow/contrib/hooks/fs\_hook.py](https://codecov.io/gh/apache/airflow/pull/7145/diff?src=pr&el=tree#diff-YWlyZmxvdy9jb250cmliL2hvb2tzL2ZzX2hvb2sucHk=) | `100% <100%> (+10%)` | :arrow_up: |
   | [airflow/contrib/sensors/weekday\_sensor.py](https://codecov.io/gh/apache/airflow/pull/7145/diff?src=pr&el=tree#diff-YWlyZmxvdy9jb250cmliL3NlbnNvcnMvd2Vla2RheV9zZW5zb3IucHk=) | `100% <100%> (+4%)` | :arrow_up: |
   | [airflow/contrib/sensors/file\_sensor.py](https://codecov.io/gh/apache/airflow/pull/7145/diff?src=pr&el=tree#diff-YWlyZmxvdy9jb250cmliL3NlbnNvcnMvZmlsZV9zZW5zb3IucHk=) | `100% <100%> (ø)` | :arrow_up: |
   | [airflow/hooks/filesystem.py](https://codecov.io/gh/apache/airflow/pull/7145/diff?src=pr&el=tree#diff-YWlyZmxvdy9ob29rcy9maWxlc3lzdGVtLnB5) | `90% <90%> (ø)` | |
   | [airflow/sensors/weekday\_sensor.py](https://codecov.io/gh/apache/airflow/pull/7145/diff?src=pr&el=tree#diff-YWlyZmxvdy9zZW5zb3JzL3dlZWtkYXlfc2Vuc29yLnB5) | `96% <96%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/airflow/pull/7145?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/airflow/pull/7145?src=pr&el=footer). Last update [6df30a3...8e37650](https://codecov.io/gh/apache/airflow/pull/7145?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [airflow] mik-laj commented on a change in pull request #7145: [AIRFLOW-6543][AIP-21] Promotion of contrib classes to the core

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #7145: [AIRFLOW-6543][AIP-21] Promotion of contrib classes to the core
URL: https://github.com/apache/airflow/pull/7145#discussion_r365598405
 
 

 ##########
 File path: airflow/contrib/sensors/file_sensor.py
 ##########
 @@ -16,54 +16,14 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-#
-
-import os
-from glob import glob
-
-from airflow.contrib.hooks.fs_hook import FSHook
-from airflow.sensors.base_sensor_operator import BaseSensorOperator
-from airflow.utils.decorators import apply_defaults
-
-
-class FileSensor(BaseSensorOperator):
-    """
-    Waits for a file or folder to land in a filesystem.
-
-    If the path given is a directory then this sensor will only return true if
-    any files exist inside it (either directly, or within a subdirectory)
-
-    :param fs_conn_id: reference to the File (path)
-        connection id
-    :type fs_conn_id: str
-    :param filepath: File or folder name (relative to
-        the base path set within the connection), can be a glob.
-    :type fs_conn_id: str
-    """
-    template_fields = ('filepath',)
-    ui_color = '#91818a'
-
-    @apply_defaults
-    def __init__(self,
-                 filepath,
-                 fs_conn_id='fs_default',
-                 *args,
-                 **kwargs):
-        super().__init__(*args, **kwargs)
-        self.filepath = filepath
-        self.fs_conn_id = fs_conn_id
+"""This module is deprecated. Please use `airflow.sensors.fs`."""
 
 Review comment:
   It is a common abbreviation. We have HDFS already.  If you have suggestions, I invite you to a discussion on the mailing list.
   https://lists.apache.org/thread.html/bdc1a070295121782e2e054ae62cac363ef84540b48f750916eae88a%40%3Cdev.airflow.apache.org%3E

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services