Esempio n. 1
0
    def __init__(self, path, format=None, client=None):
        super(S3Target, self).__init__(path)
        if format is None:
            format = get_default_format()

        self.format = format
        self.fs = client or S3Client()
Esempio n. 2
0
    def __init__(self, path, client=None, format=None):
        super(WebHdfsTarget, self).__init__(path)
        path = self.path
        self.fs = client or WebHdfsClient()
        if format is None:
            format = get_default_format()

        self.format = format
Esempio n. 3
0
    def __init__(self, path, format=None, client=None, **kwargs):
        super(S3Target, self).__init__(path)
        if format is None:
            format = get_default_format()

        self.path = path
        self.format = format
        self.fs = client or S3Client()
        self.s3_options = kwargs
Esempio n. 4
0
    def __init__(self, path, format=None, client=None, **kwargs):
        super(S3Target, self).__init__(path)
        if format is None:
            format = get_default_format()

        self.path = path
        self.format = format
        self.fs = client or S3Client()
        self.s3_options = kwargs
Esempio n. 5
0
    def __init__(self, path, format=None, client=None):
        super(S3Target, self).__init__(path)
        if format is None:
            format = get_default_format()

        # Allow to write unicode in file for retrocompatibility
        if sys.version_info[:2] <= (2, 6):
            format = format >> MixedUnicodeBytes

        self.format = format
        self.fs = client or S3Client()
Esempio n. 6
0
    def __init__(self, fn, is_tmp=None, mirror_on_stderr=False, format=None):
        self._mirror_on_stderr = mirror_on_stderr
        self.path = fn
        if format is None:
            format = get_default_format()

        # Allow to write unicode in file for retrocompatibility
        if six.PY2:
            format = format >> MixedUnicodeBytes

        self.format = format
Esempio n. 7
0
    def __init__(self, fn, is_tmp=None, mirror_on_stderr=False, format=None):
        self._mirror_on_stderr = mirror_on_stderr
        self.path = fn
        if format is None:
            format = get_default_format()

        # Allow to write unicode in file for retrocompatibility
        if six.PY2:
            format = format >> MixedUnicodeBytes

        self.format = format
Esempio n. 8
0
File: s3.py Progetto: wwj718/luigi
    def __init__(self, path, format=None, client=None):
        super(S3Target, self).__init__(path)
        if format is None:
            format = get_default_format()

        # Allow to write unicode in file for retrocompatibility
        if sys.version_info[:2] <= (2, 6):
            format = format >> MixedUnicodeBytes

        self.format = format
        self.fs = client or S3Client()
Esempio n. 9
0
    def __init__(self, path=None, format=None, is_tmp=False):
        if format is None:
            format = get_default_format()

        if not path:
            if not is_tmp:
                raise Exception('path or is_tmp must be set')
            path = os.path.join(tempfile.gettempdir(), 'luigi-tmp-%09d' % random.randint(0, 999999999))
        super(LocalTarget, self).__init__(path)
        self.format = format
        self.is_tmp = is_tmp
Esempio n. 10
0
    def __init__(self, path, format=None, gcs_filesystem=None):
        super(GcsTarget, self).__init__(path)
        if format is None:
            format = get_default_format()

        # Allow to write unicode in file for retrocompatibility
        if sys.version_info[:2] <= (2, 6):
            format = format >> MixedUnicodeBytes

        self.format = format
        self.fs = gcs_filesystem or GcsFileSystem()
Esempio n. 11
0
    def __init__(self, path=None, format=None, is_tmp=False):
        if format is None:
            format = get_default_format()

        if not path:
            if not is_tmp:
                raise Exception('path or is_tmp must be set')
            path = os.path.join(tempfile.gettempdir(), 'luigi-tmp-%09d' % random.randint(0, 999999999))
        super(LocalTarget, self).__init__(path)
        self.format = format
        self.is_tmp = is_tmp
Esempio n. 12
0
    def __init__(self, path=None, format=None, is_tmp=False):
        if format is None:
            format = get_default_format()

        # Allow to write unicode in file for retrocompatibility
        if sys.version_info[:2] <= (2, 6):
            format = format >> MixedUnicodeBytes

        if not path:
            if not is_tmp:
                raise Exception('path or is_tmp must be set')
            path = os.path.join(tempfile.gettempdir(), 'luigi-tmp-%09d' % random.randint(0, 999999999))
        super(LocalTarget, self).__init__(path)
        self.format = format
        self.is_tmp = is_tmp
Esempio n. 13
0
    def __init__(self, path=None, format=None, is_tmp=False):
        if format is None:
            format = get_default_format()

        # Allow to write unicode in file for retrocompatibility
        if sys.version_info[:2] <= (2, 6):
            format = format >> MixedUnicodeBytes

        if not path:
            if not is_tmp:
                raise Exception('path or is_tmp must be set')
            path = os.path.join(tempfile.gettempdir(), 'luigi-tmp-%09d' % random.randint(0, 999999999))
        super(LocalTarget, self).__init__(path)
        self.format = format
        self.is_tmp = is_tmp
Esempio n. 14
0
File: s3.py Progetto: h3biomed/luigi
    def __init__(self, path, format=None, client=None, flag="_SUCCESS"):
        """
        Initializes a S3FlagTarget.

        :param path: the directory where the files are stored.
        :type path: str
        :param client:
        :type client:
        :param flag:
        :type flag: str
        """
        if format is None:
            format = get_default_format()

        if path[-1] != "/":
            raise ValueError("S3FlagTarget requires the path to be to a " "directory.  It must end with a slash ( / ).")
        super(S3FlagTarget, self).__init__(path, format, client)
        self.flag = flag
Esempio n. 15
0
    def __init__(self, path, format=None, client=None, flag='_SUCCESS'):
        """
        Initializes a S3FlagTarget.

        :param path: the directory where the files are stored.
        :type path: str
        :param client:
        :type client:
        :param flag:
        :type flag: str
        """
        if format is None:
            format = get_default_format()

        if path[-1] != "/":
            raise ValueError("S3FlagTarget requires the path to be to a "
                             "directory.  It must end with a slash ( / ).")
        super(S3FlagTarget, self).__init__(path, format, client)
        self.flag = flag
Esempio n. 16
0
    def __init__(self,
                 path,
                 format=None,
                 client=None,
                 remote_temp_write=False,
                 boto3_session_kwargs=None,
                 **kwargs):
        """
        Creates an S3Target that can be opened for reading or writing.

        Setting remote_temp_write to True will place the temporary file on S3
        instead of the local file system. Requires boto3 >=1.4.0.
        """
        super(S3Target, self).__init__(path)
        if format is None:
            format = get_default_format()

        self.path = path
        self.format = format
        self.fs = client or S3Client()
        self.s3_options = kwargs
        self.remote_temp_write = remote_temp_write
        self.boto3_session_kwargs = boto3_session_kwargs
Esempio n. 17
0
 def __init__(self, path, format=None, client=None):
     super(S3Target, self).__init__(path)
     if format is None:
         format = get_default_format()
     self.format = format
     self.fs = client or S3Client()
Esempio n. 18
0
 def __init__(self, path=None, format=None, is_tmp=False):
     if format is None:
         format = get_default_format()
     super(LocalTarget, self).__init__(path)
     self.format = format
Esempio n. 19
0
 def __init__(self, fn, is_tmp=None, mirror_on_stderr=False, format=None):
     self._mirror_on_stderr = mirror_on_stderr
     self.path = fn
     self.format = format or get_default_format()
Esempio n. 20
0
 def __init__(self, fn, is_tmp=None, mirror_on_stderr=False, format=None):
     self._mirror_on_stderr = mirror_on_stderr
     self._fn = fn
     if format is None:
         format = get_default_format()
     self.format = format