Skip to content

Commit

Permalink
upgrade pylint
Browse files Browse the repository at this point in the history
Test Plan: buildkite

Reviewers: #ft, natekupp

Reviewed By: #ft, natekupp

Differential Revision: https://dagster.phacility.com/D1077
  • Loading branch information
alangenfeld committed Sep 25, 2019
1 parent f26dd63 commit 05185d3
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@
def write_zip_file_to_disk(zip_file_path, archive_member, data):
with zipfile.ZipFile(zip_file_path, mode='w') as archive:
# writable stream with archive.open not available < 3.6
kwargs = (
{'bytes': data, 'zinfo_or_arcname': archive_member}
if sys.version_info.major < 3
else {'data': data, 'zinfo_or_arcname': archive_member}
)

archive.writestr(**kwargs)
if sys.version_info.major < 3:
# pylint: disable=unexpected-keyword-arg
archive.writestr(bytes=data, zinfo_or_arcname=archive_member)
else:
archive.writestr(data=data, zinfo_or_arcname=archive_member)


def test_unzip_file_handle():
Expand Down
2 changes: 1 addition & 1 deletion examples/dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pyspark==2.4.4
mock==2.0.0
docker-compose==1.23.2
pylint>=2.3.0
pylint>=2.4.1
pytest==4.6.3
pytest-cov==2.7.1
2 changes: 1 addition & 1 deletion python_modules/dagit/dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pylint>=2.3.0; python_version >= '3.6'
pylint>=2.4.1; python_version >= '3.6'
pre-commit==1.10.1
pytest==4.6.3
pytest-cov==2.7.1
Expand Down
2 changes: 1 addition & 1 deletion python_modules/dagster-graphql/dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pylint>=2.3.0; python_version >= '3.6'
pylint>=2.4.1; python_version >= '3.6'
pre-commit==1.10.1
pytest==4.6.3
pytest-cov==2.7.1
Expand Down
1 change: 0 additions & 1 deletion python_modules/dagster/dagster/core/execution/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ def execute_pipeline_with_preset(pipeline, preset_name, run_config=None, instanc

preset = pipeline.get_preset(preset_name)

pipeline = pipeline
if preset.solid_subset is not None:
pipeline = pipeline.build_sub_pipeline(preset.solid_subset)

Expand Down
2 changes: 1 addition & 1 deletion python_modules/dagster/dagster/core/storage/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def handle_run_event(self, run_id, event):
'''

@abstractmethod
@abstractproperty
def all_runs(self):
'''Return all the runs present in the storage.
Expand Down
1 change: 1 addition & 0 deletions python_modules/dagster/dagster/core/types/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ def __init__(self, inner_type, *args, **kwargs):
self.inner_type = check.inst_param(inner_type, 'inner_type', ConfigType)
super(ConfigList, self).__init__(*args, **kwargs)

@property
def is_list(self):
return True

Expand Down
1 change: 1 addition & 0 deletions python_modules/dagster/dagster/core/types/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ def __init__(self, key=None, name=None, **kwargs):
**kwargs
)

@property
def is_scalar(self):
return True

Expand Down
3 changes: 2 additions & 1 deletion python_modules/dagster/dagster/seven/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
TemporaryDirectory = tempfile.TemporaryDirectory

try:
FileNotFoundError = FileNotFoundError # pylint:disable=redefined-builtin
# pylint:disable=redefined-builtin,self-assigning-variable
FileNotFoundError = FileNotFoundError
except NameError:
FileNotFoundError = IOError

Expand Down
2 changes: 1 addition & 1 deletion python_modules/dagster/dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ black==18.9b0; python_version >= '3.6'
flake8>=3.7.8
isort>=4.3.21
nbsphinx==0.4.2
pylint>=2.3.0; python_version >= '3.6'
pylint>=2.4.1; python_version >= '3.6'
pytest==4.6.3
pytest-cov==2.7.1
pytest-dependency==0.4.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def nuke():
client = boto3.client('ec2', region_name=cfg.region)
ec2 = boto3.resource('ec2', region_name=cfg.region)

instances = ec2.instances.filter(InstanceIds=[cfg.instance_id])
instances = ec2.instances.filter(InstanceIds=[cfg.instance_id]) # pylint: disable=no-member

Term.warning('This will terminate the following: ')
for instance in instances:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def handle_run_event(self, run_id, event):
def _rows_to_runs(self, rows):
return list(map(lambda r: deserialize_json_to_dagster_namedtuple(r[0]), rows))

@property
def all_runs(self):
'''Return all the runs present in the storage.
Expand Down Expand Up @@ -153,5 +154,6 @@ def wipe(self):
with conn.cursor() as curs:
curs.execute(DELETE_FROM_SQL)

@property
def is_persistent(self):
return True
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def test_add_get_postgres_run_storage(pg_db):
assert run_storage.has_run(run_id)
assert not run_storage.has_run(str(uuid.uuid4()))

assert run_storage.all_runs() == [run_to_add]
assert run_storage.all_runs == [run_to_add]
assert run_storage.all_runs_for_pipeline('pipeline_name') == [run_to_add]
assert run_storage.all_runs_for_pipeline('nope') == []

run_storage.wipe()
assert run_storage.all_runs() == []
assert run_storage.all_runs == []


def test_handle_run_event_pipeline_success_test():
Expand Down
2 changes: 1 addition & 1 deletion scala_modules/scripts/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def deploy():
raise Exception(
'bucket not provided; did you forget to export GCP_DEPLOY_BUCKET in your environment?'
)

# pylint: disable=unexpected-keyword-arg
git_commit_hash = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=SCRIPT_PATH).strip()

if sys.version_info.major >= 3:
Expand Down

0 comments on commit 05185d3

Please sign in to comment.