Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use group-name/export-time from log file if present #306

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

mikix
Copy link
Contributor

@mikix mikix commented Apr 12, 2024

When loading ndjson from a folder, parse any sibling logs we find for export info like group/time.

These are the current workflow assumptions this adds (but this is all still optional - no error will happen if a log doesn't exist):

  • There will be a log.ndjson or log.*.ndjson file in the given folder.
    • There cannot be multiples (unless log.ndjson exists, in which case we always use that)
  • That log file will be for a single export.
    • e.g. We will generally grab the last "kickoff" event and ignore others.

Checklist

  • Consider if documentation (like in docs/) needs to be updated
  • Consider if tests should be added

When loading ndjson from a folder, parse any sibling logs we find
for export info like group/time.

These are the current workflow assumptions this adds:

- There will be a log.ndjson or log.*.ndjson file in the given folder.
  - There cannot be multiples (unless log.ndjson exists, in which case
    we always use that)
- That log file will be for a single export.
  - e.g. We will generally grab the last "kickoff" event and ignore
    others.
case "status_complete":
self._parse_status_complete(row)
except (KeyError, json.JSONDecodeError) as exc:
raise self.IncompleteLog(f"Error parsing '{path}'") from exc
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: consider a MissingLog error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah that actually does exist (I used NoLogs), in the find method below (along with MultipleLogs).

Currently nothing actually distinguishes between these flavors of error. Maybe they will in the future, but 🤷

@mikix mikix merged commit 09073cb into main Apr 17, 2024
3 checks passed
@mikix mikix deleted the mikix/completion2 branch April 17, 2024 16:14
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