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

[BUG] Another uncaught exception in the pull command #75

Closed
MWSammons opened this issue May 9, 2024 · 0 comments · Fixed by #76
Closed

[BUG] Another uncaught exception in the pull command #75

MWSammons opened this issue May 9, 2024 · 0 comments · Fixed by #76
Assignees

Comments

@MWSammons
Copy link
Contributor

Following up with previous issue #73 the same command now results in the following uncaught exception :

datatrail pull chime.event.intensity.raw 60011290 -vv
[15:29:56] DEBUG    `pull` called with:                                                      pull.py:69
           DEBUG    scope: chime.event.intensity.raw [<class 'str'>]                         pull.py:70
           DEBUG    dataset: 60011290 [<class 'str'>]                                        pull.py:71
           DEBUG    verbose: 2 [<class 'int'>]                                               pull.py:72
           DEBUG    quiet: False [<class 'bool'>]                                            pull.py:73
           DEBUG    Loading config.                                                          pull.py:77
           DEBUG    Site set to: local.                                                      pull.py:80
           INFO     No directory, setting to: ./.                                            pull.py:83

Searching for files for 60011290 chime.event.intensity.raw...

           INFO     Finding files for 60011290 in chime.event.intensity.raw.           functions.py:186
           DEBUG    Payload: {'scope': 'chime.event.intensity.raw', 'name':            functions.py:188
                    '60011290'}                                                                        
           DEBUG    URL: https://frb.chimenet.ca/datatrail/query/dataset/find          functions.py:190
[15:29:58] DEBUG    Status: 500.                                                       functions.py:192
           DEBUG    Decoding response.                                                 functions.py:193
Could not find 60011290 chime.event.intensity.raw in Datatrail.
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Users/mawsonsammons/Documents/McGill/.venv/bin/datatrail:8 in <module>                          │
│                                                                                                  │
│   5 from dtcli.cli import cli                                                                    │
│   6 if __name__ == '__main__':                                                                   │
│   7 │   sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])                         │
│ ❱ 8 │   sys.exit(cli())                                                                          │
│   9                                                                                              │
│                                                                                                  │
│ /Users/mawsonsammons/Documents/McGill/.venv/lib/python3.11/site-packages/click/core.py:1157 in   │
│ __call__                                                                                         │
│                                                                                                  │
│   1154 │                                                                                         │
│   1155 │   def __call__(self, *args: t.Any, **kwargs: t.Any) -> t.Any:                           │
│   1156 │   │   """Alias for :meth:`main`."""                                                     │
│ ❱ 1157 │   │   return self.main(*args, **kwargs)                                                 │
│   1158                                                                                           │
│   1159                                                                                           │
│   1160 class Command(BaseCommand):                                                               │
│                                                                                                  │
│ /Users/mawsonsammons/Documents/McGill/.venv/lib/python3.11/site-packages/click/core.py:1078 in   │
│ main                                                                                             │
│                                                                                                  │
│   1075 │   │   try:                                                                              │
│   1076 │   │   │   try:                                                                          │
│   1077 │   │   │   │   with self.make_context(prog_name, args, **extra) as ctx:                  │
│ ❱ 1078 │   │   │   │   │   rv = self.invoke(ctx)                                                 │
│   1079 │   │   │   │   │   if not standalone_mode:                                               │
│   1080 │   │   │   │   │   │   return rv                                                         │
│   1081 │   │   │   │   │   # it's not safe to `ctx.exit(rv)` here!                               │
│                                                                                                  │
│ /Users/mawsonsammons/Documents/McGill/.venv/lib/python3.11/site-packages/click/core.py:1688 in   │
│ invoke                                                                                           │
│                                                                                                  │
│   1685 │   │   │   │   super().invoke(ctx)                                                       │
│   1686 │   │   │   │   sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)                    │
│   1687 │   │   │   │   with sub_ctx:                                                             │
│ ❱ 1688 │   │   │   │   │   return _process_result(sub_ctx.command.invoke(sub_ctx))               │
│   1689 │   │                                                                                     │
│   1690 │   │   # In chain mode we create the contexts step by step, but after the                │
│   1691 │   │   # base command has been invoked.  Because at that point we do not                 │
│                                                                                                  │
│ /Users/mawsonsammons/Documents/McGill/.venv/lib/python3.11/site-packages/click/core.py:1434 in   │
│ invoke                                                                                           │
│                                                                                                  │
│   1431 │   │   │   echo(style(message, fg="red"), err=True)                                      │
│   1432 │   │                                                                                     │
│   1433 │   │   if self.callback is not None:                                                     │
│ ❱ 1434 │   │   │   return ctx.invoke(self.callback, **ctx.params)                                │
│   1435 │                                                                                         │
│   1436 │   def shell_complete(self, ctx: Context, incomplete: str) -> t.List["CompletionItem"]:  │
│   1437 │   │   """Return a list of completions for the incomplete value. Looks                   │
│                                                                                                  │
│ /Users/mawsonsammons/Documents/McGill/.venv/lib/python3.11/site-packages/click/core.py:783 in    │
│ invoke                                                                                           │
│                                                                                                  │
│    780 │   │                                                                                     │
│    781 │   │   with augment_usage_errors(__self):                                                │
│    782 │   │   │   with ctx:                                                                     │
│ ❱  783 │   │   │   │   return __callback(*args, **kwargs)                                        │
│    784 │                                                                                         │
│    785 │   def forward(                                                                          │
│    786 │   │   __self, __cmd: "Command", *args: t.Any, **kwargs: t.Any  # noqa: B902             │
│                                                                                                  │
│ /Users/mawsonsammons/Documents/McGill/.venv/lib/python3.11/site-packages/click/decorators.py:33  │
│ in new_func                                                                                      │
│                                                                                                  │
│    30 │   """                                                                                    │
│    31 │                                                                                          │
│    32 │   def new_func(*args: "P.args", **kwargs: "P.kwargs") -> "R":                            │
│ ❱  33 │   │   return f(get_current_context(), *args, **kwargs)                                   │
│    34 │                                                                                          │
│    35 │   return update_wrapper(new_func, f)                                                     │
│    36                                                                                            │
│                                                                                                  │
│ /Users/mawsonsammons/Documents/McGill/.venv/lib/python3.11/site-packages/dtcli/pull.py:103 in    │
│ pull                                                                                             │
│                                                                                                  │
│   100 │   # Find files missing from localhost.                                                   │
│   101 │   console.print(f"\nSearching for files for {dataset} {scope}...\n")                     │
│   102 │   files = find_missing_dataset_files(scope, dataset, directory, verbose)                 │
│ ❱ 103 │   if len(files["missing"]) == 0 and len(files["existing"]) == 0:                         │
│   104 │   │   console.print("No files found at minoc.", style="bold red")                        │
│   105 │   │   return None                                                                        │
│   106 │   files_paths = [f.replace("cadc:CHIMEFRB", "") for f in files["missing"]]               │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
KeyError: 'missing'
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 a pull request may close this issue.

2 participants