[
https://issues.apache.org/jira/browse/BEAM-10101?focusedWorklogId=451295&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-451295
]
ASF GitHub Bot logged work on BEAM-10101:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 25/Jun/20 21:02
Start Date: 25/Jun/20 21:02
Worklog Time Spent: 10m
Work Description: epicfaace commented on a change in pull request #11824:
URL: https://github.com/apache/beam/pull/11824#discussion_r445836086
##########
File path: sdks/python/apache_beam/io/httpio.py
##########
@@ -0,0 +1,172 @@
+#
+# 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.
+#
+
+"""This class implements methods to interact with files at HTTP URLs.
+
+This I/O only implements methods to read with files at HTTP URLs, because
+of the variability in methods by which HTTP content can be written
+to a server. If you need to write your results to an HTTP endpoint,
+you might want to make your own I/O or use another, more specific,
+I/O connector.
+
+"""
+
+# pytype: skip-file
+
+from __future__ import absolute_import
+
+import io
+from builtins import object
+
+from apache_beam.io.filesystem import BeamIOError
+from apache_beam.io.filesystemio import Downloader
+from apache_beam.io.filesystemio import DownloaderStream
+from apache_beam.internal.http_client import get_new_http
+import sys
+from httplib2 import HttpLib2Error
+
+REQUEST_FAILED_ERROR_MSG = "HTTP request failed for URL {}: {}"
+UNEXPECTED_STATUS_CODE_ERROR_MSG = "Unexpected status code received for URL
{}: {} {}"
+
+
+class HttpIO(object):
Review comment:
```suggestion
class HttpIO:
```
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 451295)
Time Spent: 3h 10m (was: 3h)
> Add a HttpIO / HttpFileSystem
> -----------------------------
>
> Key: BEAM-10101
> URL: https://issues.apache.org/jira/browse/BEAM-10101
> Project: Beam
> Issue Type: Bug
> Components: io-ideas
> Reporter: Ashwin Ramaswami
> Assignee: Ashwin Ramaswami
> Priority: P2
> Time Spent: 3h 10m
> Remaining Estimate: 0h
>
> Add HttpIO (and a related HttpFileSystem and HttpsFileSystem), which can
> download files from a particular http:// or https:// URL. HttpIO cannot
> upload / write to files, though, because there's no standardized way to write
> to files using HTTP.
> Sample usage:
>
> {code:python}
> (
> p
> |
> ReadFromText("https://raw.githubusercontent.com/apache/beam/5ff5313f0913ec81d31ad306400ad30c0a928b34/NOTICE")
> | WriteToText("output.txt", shard_name_template="", num_shards=0)
> )
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)