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

Add the most obvious Exception types and good logging #1309

Closed
4 tasks done
blythed opened this issue Nov 15, 2023 · 1 comment
Closed
4 tasks done

Add the most obvious Exception types and good logging #1309

blythed opened this issue Nov 15, 2023 · 1 comment
Assignees
Labels

Comments

@fnikolai
Copy link
Collaborator

fnikolai commented Nov 17, 2023

  • When interacting with any external system (mongo, ibis, dask), add an info log, and then a success log. Your may use: debug(), info(), warn(), error()
from superduperdb import logging.

logging.info("Connecting to: <type of service}")
.... connect() ...
logging.success("Connected to: ", <client_info>)
  • When submitting a request to an external system (mongo, ibis, dask), add an info log, and then a success log.
from superduperdb import logging.

logging.info("Submit job: <job description}")
.... submit() ...
logging.success("Submitted job: ", <job_id or future>)
  • Wrap interactions with external systems (mongo, ibis, dask), into a try-catch. Fail-fast if an exception happens.
  try:
      databackend = build(cfg.data_backend, data_backends)
      logging.info("Data Client is ready.", databackend.conn)
  except Exception as e:
      # Exit quickly if a connection fails.
      logging.error("Error initializing to DataBackend Client:", str(e))
      sys.exit(1)

@blythed blythed changed the title Add the most obvious Exception types Add the most obvious Exception types and good logging Nov 17, 2023
@blythed blythed closed this as completed Dec 5, 2023
@github-project-automation github-project-automation bot moved this from To Do to Done in superduper-open-source Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

3 participants