Skip to content

Commit 2e92a33

Browse files
authored
Format code with black (#68)
* Format code with black * Fix
1 parent a2a6b0a commit 2e92a33

22 files changed

+376
-293
lines changed

.github/workflows/build.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ jobs:
3131
set -e
3232
3333
/github/home/.local/bin/poetry install
34+
- name: Black
35+
shell: bash
36+
run: |
37+
set -e
38+
/github/home/.local/bin/poetry run black . --check --diff
3439
- name: Lint
3540
run: |
3641
set -e

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Hadoop FileSystem Java Class Wrapper
2+
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
3+
24
Typed Python wrappers for [Hadoop FileSystem](https://hadoop.apache.org/docs/stable/api/org/apache/hadoop/fs/FileSystem.html) class family.
35

46
## Installation
@@ -42,4 +44,4 @@ def is_valid_source_path(file_system: FileSystem, path: str) -> bool:
4244
Currently basic filesystem operations (listing, deleting, search, iterative listing etc.) are supported. If an operation you require is not yet wrapped,
4345
please open an issue or create a PR.
4446

45-
All changes are tested against Spark 3.2/3.3 running in local mode.
47+
All changes are tested against Spark 3.2/3.3 running in local mode.

hadoop_fs_wrapper/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
Version file.
2525
"""
2626

27-
__version__ = '0.0.0' # replaced by git tag on deploy
27+
__version__ = "0.0.0" # replaced by git tag on deploy

hadoop_fs_wrapper/models/buffered_input_stream.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@
2727

2828
class BufferedInputStream:
2929
"""
30-
Wrapper for java.io.BufferedInputStream
30+
Wrapper for java.io.BufferedInputStream
3131
"""
32+
3233
def __init__(self, underlying):
3334
"""
34-
Class init
35+
Class init
3536
"""
3637
self.underlying = underlying
3738

hadoop_fs_wrapper/models/buffered_output_stream.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@
2727

2828
class BufferedOutputStream:
2929
"""
30-
Wrapper for java.io.BufferedOutputStream
30+
Wrapper for java.io.BufferedOutputStream
3131
"""
32+
3233
def __init__(self, underlying):
3334
"""
34-
Class init
35+
Class init
3536
"""
3637
self.underlying = underlying
3738

hadoop_fs_wrapper/models/buffered_reader.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@
2727

2828
class BufferedReader:
2929
"""
30-
Wrapper for java.io.BufferedReader
30+
Wrapper for java.io.BufferedReader
3131
"""
32+
3233
def __init__(self, underlying):
3334
"""
34-
Class init
35+
Class init
3536
"""
3637
self.underlying = underlying
3738

hadoop_fs_wrapper/models/file_status.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,66 +27,67 @@
2727

2828
class FileStatus:
2929
"""
30-
Wrapper for org.apache.hadoop.fs.FileStatus
30+
Wrapper for org.apache.hadoop.fs.FileStatus
3131
"""
32+
3233
def __init__(self, underlying):
3334
"""
34-
Class init
35+
Class init
3536
"""
3637
self.underlying = underlying
3738

3839
def get_path(self) -> str:
3940
"""
40-
Wraps getPath() method.
41+
Wraps getPath() method.
4142
4243
"""
4344
return self.underlying.getPath().toString()
4445

4546
def get_owner(self) -> str:
4647
"""
47-
Wraps getOwner() method.
48+
Wraps getOwner() method.
4849
4950
"""
5051
return self.underlying.getOwner()
5152

5253
def get_group(self) -> str:
5354
"""
54-
Wraps getGroup() method.
55+
Wraps getGroup() method.
5556
5657
"""
5758
return self.underlying.getGroup()
5859

5960
def get_permission(self) -> str:
6061
"""
61-
Wraps getPermission() method.
62+
Wraps getPermission() method.
6263
6364
"""
6465
return self.underlying.getPermission().toString()
6566

6667
def get_modification_time(self) -> int:
6768
"""
68-
Wraps getModificationTime() method.
69+
Wraps getModificationTime() method.
6970
7071
"""
7172
return self.underlying.getModificationTime()
7273

7374
def is_file(self) -> bool:
7475
"""
75-
Wraps isFile() method.
76+
Wraps isFile() method.
7677
7778
"""
7879
return self.underlying.isFile()
7980

8081
def get_block_size(self) -> int:
8182
"""
82-
Wraps getBlockSize() method.
83+
Wraps getBlockSize() method.
8384
8485
"""
8586
return self.underlying.getBlockSize()
8687

8788
def get_file_length(self) -> int:
8889
"""
89-
Wraps getLen() method.
90+
Wraps getLen() method.
9091
9192
"""
9293
return self.underlying.getLen()

hadoop_fs_wrapper/models/fs_data_input_stream.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727

2828
class FSDataInputStream:
2929
"""
30-
Wrapper for org.apache.hadoop.fs.FSDataInputStream
30+
Wrapper for org.apache.hadoop.fs.FSDataInputStream
3131
"""
32+
3233
def __init__(self, underlying):
3334
"""
34-
Class init
35+
Class init
3536
"""
3637
self.underlying = underlying

hadoop_fs_wrapper/models/fs_data_output_stream.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727

2828
class FSDataOutputStream:
2929
"""
30-
Wrapper for org.apache.hadoop.fs.FSDataOutputStream
30+
Wrapper for org.apache.hadoop.fs.FSDataOutputStream
3131
"""
32+
3233
def __init__(self, underlying):
3334
"""
34-
Class init
35+
Class init
3536
"""
3637
self.underlying = underlying

hadoop_fs_wrapper/models/glob_filter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@
2727

2828
class GlobFilter:
2929
"""
30-
Wrapper for org.apache.hadoop.fs.GlobFilter
30+
Wrapper for org.apache.hadoop.fs.GlobFilter
3131
"""
32+
3233
def __init__(self, underlying):
3334
"""
34-
Class init
35+
Class init
3536
"""
3637
self.underlying = underlying
3738

0 commit comments

Comments
 (0)