Skip to main content
Looking for W&B Weave? W&B’s suite of tools for Generative AI application building? Find the docs for weave here: wandb.me/weave.
Use query panels to query and interactively visualize your data. A query panel combines three pieces:
  1. Expression: The data you select.
  2. Configuration: Optional settings for the panel, such as the panel type and options from the gear menu.
  3. Result panel: How to show the results, such as in a table or plot.
For a broad set of interactive examples you can try, see a public Query panel examples report. For a guided walkthrough of query syntax, see the Query panel tutorial report. Generated types and ops are listed in the query expression language overview.
Query panel

Create a query panel

Add a query to your workspace or within a report.
  1. Navigate to your project’s workspace.
  2. In the upper right hand corner, click Add panel.
  3. From the dropdown, select Query panel.

Query components

Expressions

Use query expressions to query your data stored in W&B such as runs, artifacts, models, tables, and more.

Example: Query a table

Suppose you want to query a W&B Table. In your training code you log a table called "cifar10_sample_table":
import wandb
with wandb.init() as run:
  run.log({"cifar10_sample_table":<MY_TABLE>})
Within the query panel you can query your table with:
runs.summary["cifar10_sample_table"]
Table query expression
Breaking this down:
  • runs is a variable automatically injected in Query Panel Expressions when the Query Panel is in a Workspace. Its “value” is the list of runs which are visible for that particular Workspace. Read about the different attributes available within a run here.
  • summary is an op which returns the Summary object for a Run. Ops are mapped, meaning this op is applied to each Run in the list, resulting in a list of Summary objects.
  • ["cifar10_sample_table"] is a Pick op (denoted with brackets), with a key of cifar10_sample_table. Since Summary objects act like dictionaries or maps, this operation picks that field from each Summary object.

Configurations

Select the gear icon on the upper left corner of the panel to expand the query configuration. This allows the user to configure the type of panel and the parameters for the result panel.
Panel configuration menu

Panel options

The configuration menu can include options that change how table-style results are combined or loaded. Exact labels and availability can depend on your expression and panel type. Use the Query panel examples report for concrete setups. Concat Use Concat in the configuration when you want compatible table-style results merged so the panel treats them as a single table for viewing and downstream operations. Expression-level row merging (for example concat and join in the query) is separate from this setting. See Combine tables in expressions. Paginate Use Paginate when a table result may be too large to render at once. Pagination loads rows in chunks so the panel stays responsive. Pair this option with expressions that return large row lists. For patterns that work well with pagination, see the Query panel examples report.

Result panels

Finally, the query result panel renders the result of the query expression, using the selected query panel, configured by the configuration to display the data in an interactive form. The following images shows a Table and a Plot of the same data.
Table result panel
Plot result panel

Step through run history

In tables and plots built from runs or runs.history, the app can show a step control (for example a slider) so you can move through logged steps and inspect metrics, text, or media over the course of your runs. Once the expression is changed, edit the query panel’s configuration and change the ‘Render As’ to ‘Stepper.’ The control can follow a different metric instead of _step if it better matches how you logged data. For sample expressions, see the Query panel examples report.

Basic operations

The following common operations you can make within your query panels.

Sort

Sort from the column options:
Column sort options

Filter

You can either filter directly in the query or using the filter button in the top left corner (second image)
Query filter syntax
Filter button

Map

Map operations iterate over lists and apply a function to each element in the data. You can do this directly with a panel query or by inserting a new column from the column options.
Map operation query
Map column insertion

Groupby

You can groupby using a query or from the column options.
Group by query
Group by column options

Combine tables in expressions

Use concat, join, and related ops in your expression when you need to stack or merge row lists from tables. See Join for a full example. The Concat and Paginate items in Panel options are separate controls on how the UI merges and loads table results.

Join

It is also possible to join tables directly in the query. Consider the following query expression:
project("luis_team_test", "weave_example_queries").runs.summary["short_table_0"].table.rows.concat.join(\
project("luis_team_test", "weave_example_queries").runs.summary["short_table_1"].table.rows.concat,\
(row) => row["Label"],(row) => row["Label"], "Table1", "Table2",\
"false", "false")
Table join operation
The table on the left is generated from:
project("luis_team_test", "weave_example_queries").\
runs.summary["short_table_0"].table.rows.concat.join
The table in the right is generated from:
project("luis_team_test", "weave_example_queries").\
runs.summary["short_table_1"].table.rows.concat
Where:
  • (row) => row["Label"] are selectors for each table, determining which column to join on
  • "Table1" and "Table2" are the names of each table when joined
  • true and false are for left and right inner/outer join settings

Runs object

Use query panels to access the runs object. Run objects store records of your experiments. You can find more details in Accessing runs object but, as quick overview, runs object has available:
  • summary: A dictionary of information that summarizes the run’s results. This can be scalars like accuracy and loss, or large files. By default, wandb.Run.log() sets the summary to the final value of a logged time series. You can set the contents of the summary directly. Think of the summary as the run’s outputs.
  • history: A list of dictionaries meant to store values that change while the model is training such as loss. The command wandb.Run.log() appends to this object.
  • config: A dictionary of the run’s configuration information, such as the hyperparameters for a training run or the preprocessing methods for a run that creates a dataset Artifact. Think of these as the run’s “inputs”
Runs object structure

Access Artifacts

Artifacts are a core concept in W&B. They are a versioned, named collection of files and directories. Use Artifacts to track model weights, datasets, and any other file or directory. Artifacts are stored in W&B and can be downloaded or used in other runs. You can find more details and examples in Accessing artifacts. Artifacts are normally accessed from the project object:
  • project.artifactVersion(): returns the specific artifact version for a given name and version within a project
  • project.artifact(""): returns the artifact for a given name within a project. You can then use .versions to get a list of all versions of this artifact
  • project.artifactType(): returns the artifactType for a given name within a project. You can then use .artifacts to get a list of all artifacts with this type
  • project.artifactTypes: returns a list of all artifact types under the project
Artifact access methods