Skip to content

Commit

Permalink
chore: makes autopep8 happy
Browse files Browse the repository at this point in the history
Signed-off-by: weiwee <[email protected]>
  • Loading branch information
sagewe committed Aug 16, 2022
1 parent 928f62d commit c98c0c5
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ exclude =
./eggroll,
./fateboard,
./python/federatedml/secureprotol/symmetric_encryption/py_aes_core.py,
./python/federatedml/protobuf/generated
./python/federatedml/protobuf/generated,
./python/fate_arch/protobuf
3 changes: 2 additions & 1 deletion python/fate_arch/metastore/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ def _normalize_data(cls, data, kwargs):
if {f"f_{f_n}_time", f"f_{f_n}_date"}.issubset(cls._meta.combined.keys()) and \
cls._meta.combined[f"f_{f_n}_time"] in normalized and \
normalized[cls._meta.combined[f"f_{f_n}_time"]] is not None:
normalized[cls._meta.combined[f"f_{f_n}_date"]] = timestamp_to_date(normalized[cls._meta.combined[f"f_{f_n}_time"]])
normalized[cls._meta.combined[f"f_{f_n}_date"]] = timestamp_to_date(
normalized[cls._meta.combined[f"f_{f_n}_time"]])

return normalized
2 changes: 1 addition & 1 deletion python/fate_arch/session/_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def query_sessions(cls, reverse=None, order_by=None, **kwargs):
try:
session_records = SessionRecord.query(reverse=reverse, order_by=order_by, **kwargs)
return session_records
except:
except BaseException:
return []

@DB.connection_context()
Expand Down
2 changes: 1 addition & 1 deletion python/federatedml/statistic/psi/psi.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def fit(self, expect_table, actual_table):
if not self.is_sparse(actual_table): # convert missing value: nan to NoneType
actual_table = self.convert_missing_val(actual_table)

if not(self.check_table_content(expect_table) and self.check_table_content(actual_table)):
if not (self.check_table_content(expect_table) and self.check_table_content(actual_table)):
raise ValueError('contents of input table must be instances of class "Instance"')

param = FeatureBinningParam(method=consts.QUANTILE, bin_num=self.max_bin_num, local_only=True,
Expand Down
2 changes: 2 additions & 0 deletions rust/fate_crypto/scripts/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

root_path = pathlib.Path(__file__).parent.parent.resolve()


def update_version(version):
with open(root_path.joinpath("Cargo.toml")) as f:
cargo = toml.load(f)
Expand All @@ -13,6 +14,7 @@ def update_version(version):
with open(root_path.joinpath("Cargo.toml"), "w") as f:
toml.dump(cargo, f)


if __name__ == "__main__":
parse = argparse.ArgumentParser("bump version")
parse.add_argument("version", type=str)
Expand Down

0 comments on commit c98c0c5

Please sign in to comment.