Skip to content
Permalink
Browse files

upgrade pylint

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 05185d32ef914a137e728c377b3442e4a6ec5312
@@ -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():
@@ -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
@@ -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
@@ -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
@@ -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)

@@ -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.
@@ -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

@@ -515,6 +515,7 @@ def __init__(self, key=None, name=None, **kwargs):
**kwargs
)

@property
def is_scalar(self):
return True

@@ -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

@@ -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
@@ -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:
@@ -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.
@@ -153,5 +154,6 @@ def wipe(self):
with conn.cursor() as curs:
curs.execute(DELETE_FROM_SQL)

@property
def is_persistent(self):
return True
@@ -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():
@@ -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:

0 comments on commit 05185d3

Please sign in to comment.
You can’t perform that action at this time.