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]
