Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
benflexcompute committed Jan 14, 2025
1 parent c2155d0 commit 697a825
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 6 additions & 5 deletions flow360/component/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class Project(pd.BaseModel):
_root_simulation_json: Optional[dict] = pd.PrivateAttr(None)

@classmethod
def show_remote(cls, search_keyword: Union[None, str] = None, max_item_count: int = 1000):
def show_remote(cls, search_keyword: Union[None, str] = None):
"""
Shows all projects on the cloud.
Expand All @@ -174,21 +174,22 @@ def show_remote(cls, search_keyword: Union[None, str] = None, max_item_count: in
search_keyword : str, optional
"""
# pylint: disable=invalid-name
MAX_DISPLAYABLE_ITEM_COUNT = 1000
_api = RestApi(ProjectInterface.endpoint, id=None)
resp = _api.get(
params={
"page": "0",
"size": max_item_count,
"size": MAX_DISPLAYABLE_ITEM_COUNT,
"filterKeywords": search_keyword,
"sortFields": ["createdAt"],
"sortDirections": ["asc"],
}
)
if resp["total"] > max_item_count:
if resp["total"] > MAX_DISPLAYABLE_ITEM_COUNT:
log.warning(
f"Total number of projects matching the keyword on the cloud is {resp['total']}, "
f"but only the latest {max_item_count} will be displayed. "
"If you want to see all, set larger value for `max_item_count`"
f"but only the latest {MAX_DISPLAYABLE_ITEM_COUNT} will be displayed. "
)
log.info("Total number of matching projects on the cloud: %d", resp["total"])
all_projects = ProjectRecords.model_validate({"records": resp["records"]})
Expand Down
1 change: 1 addition & 0 deletions flow360/component/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,7 @@ def __str__(self):
output_str = "No matching projects found. Try skip naming patterns to show all."
return output_str
output_str = ">>> Projects sorted by creation time:\n"
# pylint: disable=not-an-iterable
for item in self.records:
output_str += f" Name: {item.name}\n"
output_str += f" Created at: {item.local_time_zone_created_time.strftime('%Y-%m-%d %H:%M %Z')}\n"
Expand Down

0 comments on commit 697a825

Please # to comment.