question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

prefect describe CLI does not return JSON

See original GitHub issue

Description

prefect describe calls seem to give back no valid JSON but just a printed Python Dict. To make it more useful in downstream commands to e.g. parse the output via jq it would be great if this is JSON. Maybe that was even intended, not sure if it is a bug or enhancement.

One example:

prefect describe flows --name TestRecoGenerationFlow_dev  | jq
parse error: Invalid numeric literal at line 1, column 8

Output of this looks like the following:

{'name': 'TestRecoGenerationFlow_dev', 'version': 17, 'created': '2020-07-07T12:43:44.554817+00:00', 'description': None, ...

With the None values instead of null it is clear that this is no JSON

Expected Behavior

Proper returning of JSON so that it can be used in downstream tools or pipes.

Reproduction

prefect describe flows --name <anyname>  | jq

Environment

{
  "config_overrides": {},
  "env_vars": [],
  "system_information": {
    "platform": "macOS-10.15.4-x86_64-i386-64bit",
    "prefect_version": "0.12.2",
    "python_version": "3.8.2"
  }
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
jcristcommented, Jul 8, 2020

Cool, I’ll push up a quick fix for this.

0reactions
joshmeekcommented, Jul 8, 2020

Yeah @jcrist JSON should be made the default

Read more comments on GitHub >

github_iconTop Results From Across the Web

describe CLI command outputs dictionary instead of json #1813
Successfully merging a pull request may close this issue. Add --output option to describe CLI commands for JSON output PrefectHQ/prefect.
Read more >
Results - Prefect 2 - Coordinating the world's dataflows
When results are persisted to storage, they are always written as a JSON document. The schema for this is described by the PersistedResultBlob...
Read more >
prefect.cli.deployment - Coordinating the world's dataflows
Prefect command line interface for working with deployments.
Read more >
prefect.client - Prefect 2 - Coordinating the world's dataflows
A no-op context will be returned if the context for the given application is already being managed. This manager is robust to concurrent...
Read more >
build | Prefect Docs
This command builds all specified flows and writes their metadata to a JSON file. These flows can then be registered without building later...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found