Skip to content

Conversation

@Marc-marc-marc
Copy link
Contributor

No description provided.

Comment on lines +526 to +535
files = response.json()
matching_file = next((f for f in files if f["name"] == self.file_name), None)

if matching_file is None:
available_files = [f["name"] for f in files] if files else []
raise FileNotFoundError(
f"File '{self.file_name}' not found at {self.url_base}/data-files. "
f"Available files: {', '.join(available_files) if available_files else 'none'}")

return datetime.datetime.fromisoformat(matching_file["updatedAt"][0:10])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion not tested

Suggested change
files = response.json()
matching_file = next((f for f in files if f["name"] == self.file_name), None)
if matching_file is None:
available_files = [f["name"] for f in files] if files else []
raise FileNotFoundError(
f"File '{self.file_name}' not found at {self.url_base}/data-files. "
f"Available files: {', '.join(available_files) if available_files else 'none'}")
return datetime.datetime.fromisoformat(matching_file["updatedAt"][0:10])
files = list(map(lambda f: f["name"], response.json()))
matching_file = next(filter(lambda f: f == self.file_name, files), None)
if matching_file is None:
raise FileNotFoundError(
f"File '{self.file_name}' not found at {self.url_base}/data-files. "
f"Available files: {', '.join(files) if files else 'none'}")
return datetime.datetime.fromisoformat(matching_file["updatedAt"][0:10])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants