> ## Documentation Index
> Fetch the complete documentation index at: https://arize-ax.mintlify.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate Pandas Client

> Migrate batch logging of traces, evaluations, and ML predictions from the v7 Pandas Client to the v8 unified ArizeClient.

The Pandas Client is used for batch logging of LLM traces, evaluations, and
traditional ML model predictions using pandas DataFrames.

<CodeGroup>
  ```python Version 7 theme={null}
  from arize.pandas.logger import Client
  client = Client(...)
  ```

  ```python Version 8 theme={null}
  from arize import ArizeClient
  client = ArizeClient(...)
  ```
</CodeGroup>

## log

The `log()` method migrates from `client.log()` to `client.ml.log()`.

### Parameter Reference

This table provides a complete mapping of all parameters between v7 and v8, including which parameters were removed, renamed, or remain unchanged.

| Parameter                  | v7          | v8                    | Changes                           |
| -------------------------- | ----------- | --------------------- | --------------------------------- |
| `space_id`                 | Client init | **Required** per call | Must pass explicitly              |
| `model_id`                 | Required    | Required              | Renamed to `model_name`           |
| `dataframe`                | Required    | Required              | --                                |
| `schema`                   | Required    | Required              | --                                |
| `environment`              | Required    | Required              | --                                |
| `model_type`               | Required    | Required              | --                                |
| `model_version`            | Optional    | Optional              | --                                |
| `batch_id`                 | Optional    | Optional              | --                                |
| `validate`                 | Optional    | Optional              | --                                |
| `metrics_validation`       | Optional    | Optional              | --                                |
| `surrogate_explainability` | Optional    | Optional              | --                                |
| `timeout`                  | Optional    | Optional              | --                                |
| `path`                     | Optional    | Optional              | Renamed to `tmp_dir` for clarity  |
| `sync`                     | Optional    | ❌ Removed             | No longer supported               |
| `verbose`                  | Optional    | ❌ Removed             | Use Python logging config instead |

### Side-by-Side Comparison

See the complete migration in action with this example showing both client initialization and logging model predictions.

<CodeGroup>
  ```python Version 7 theme={null}
  from arize.pandas.logger import Client
  from arize.utils.types import Environments, ModelTypes, Schema

  # Client initialization
  client = Client(
      api_key="your-api-key",
      space_id="your-space-id"
  )

  # Logging model predictions
  response = client.log(
      dataframe=predictions_df,
      schema=schema,
      environment=Environments.PRODUCTION,
      model_id="my-model",
      model_type=ModelTypes.BINARY_CLASSIFICATION,
      model_version="v1.0",
      batch_id="batch-123",
      metrics_validation=[Metrics.CLASSIFICATION],
      validate=True,
      path="/tmp/arize",
      surrogate_explainability=False,
      timeout=30.0,
      sync=False,
      verbose=True
  )
  ```

  ```python Version 8 theme={null}
  from arize import ArizeClient
  from arize.ml.types import Environments, ModelTypes, Schema

  # Client initialization
  client = ArizeClient(api_key="your-api-key")

  # Logging model predictions
  response = client.ml.log(
      space_id="your-space-id",  # Now required per call
      model_name="my-model",  # Renamed from model_id
      dataframe=predictions_df,
      schema=schema,
      environment=Environments.PRODUCTION,
      model_type=ModelTypes.BINARY_CLASSIFICATION,
      model_version="v1.0",
      batch_id="batch-123",
      metrics_validation=[Metrics.CLASSIFICATION],
      validate=True,
      tmp_dir="/tmp/arize",  # Renamed from path
      surrogate_explainability=False,
      timeout=30.0
      # sync parameter removed
      # verbose parameter removed
  )
  ```
</CodeGroup>

## log\_spans

The `log_spans()` method migrates from `client.log_spans()` to `client.spans.log()`.

### Parameter Reference

This table provides a complete mapping of all parameters between v7 and v8, including which parameters were removed, renamed, or remain unchanged.

| Parameter         | v7             | v8                    | Notes / Changes                   |
| ----------------- | -------------- | --------------------- | --------------------------------- |
| `space_id`        | Client init    | **Required** per call | Must pass explicitly              |
| `project_name`    | Optional       | Required              | Must pass explicitly              |
| `dataframe`       | Required       | Required              | --                                |
| `evals_dataframe` | Optional       | Optional              | --                                |
| `datetime_format` | Optional       | Optional              | --                                |
| `validate`        | Optional       | Optional              | --                                |
| `timeout`         | Optional       | Optional              | --                                |
| `model_id`        | **Deprecated** | ❌ Removed             | Use `project_name` instead        |
| `model_version`   | Optional       | ❌ Removed             | No longer supported               |
| `path`            | Optional       | Optional              | Renamed to `tmp_dir` for clarity  |
| `verbose`         | Optional       | ❌ Removed             | Use Python logging config instead |

### Side-by-Side Comparison

See the complete migration in action with this example showing both client initialization and logging spans with all common parameters.

<CodeGroup>
  ```python Version 7 theme={null}
  from arize.pandas.logger import Client

  # Client initialization
  client = Client(
      api_key="your-api-key",
      space_id="your-space-id"
  )

  # Logging spans
  response = client.log_spans(
      dataframe=spans_df,
      model_id="my-project",  # or project_name
      model_version="v1.0",   # optional
      evals_dataframe=evals_df,  # optional
      datetime_format="%Y-%m-%dT%H:%M:%S.%f+00:00",
      validate=True,
      path="/tmp/arize",
      timeout=30.0,
      verbose=True,
      project_name="my-project"  # alternative to model_id
  )
  ```

  ```python Version 8 theme={null}
  from arize import ArizeClient

  # Client initialization
  client = ArizeClient(api_key="your-api-key")

  # Logging spans
  response = client.spans.log(
      space_id="your-space-id",  # Now required per call
      project_name="my-project",  # Required, no model_id alternative
      dataframe=spans_df,
      evals_dataframe=evals_df,  # optional
      datetime_format="%Y-%m-%dT%H:%M:%S.%f+00:00",
      validate=True,
      tmp_dir="/tmp/arize",  # renamed from 'path'
      timeout=30.0
      # verbose parameter removed
      # model_version removed
  )
  ```
</CodeGroup>

## log\_evaluations & log\_evaluations\_sync

In v7, there were two separate methods for logging evaluations: `log_evaluations()`
(async HTTP) and `log_evaluations_sync()` (sync gRPC). In v8, both consolidate
into a single `update_evaluations()` method that uses gRPC by default with an
optional `force_http` parameter.

Both v7 methods (`log_evaluations` and `log_evaluations_sync`) now use the same
v8 method: `update_evaluations()`, which uses Arrow Flight (gRPC) by default, matching
the behavior of v7's `log_evaluations_sync()`. Use `force_http=True` if you need
HTTP transport (not recommended for large payloads).

### Parameter Reference

This table provides a complete mapping of all parameters between v7 and v8, including which parameters were removed, renamed, or remain unchanged.

| Parameter       | v7             | v8                    | Notes / Changes                            |
| --------------- | -------------- | --------------------- | ------------------------------------------ |
| `space_id`      | Client init    | **Required** per call | Must pass explicitly                       |
| `project_name`  | Optional       | Required              | Must pass explicitly                       |
| `dataframe`     | Required       | Required              | --                                         |
| `validate`      | Optional       | Optional              | --                                         |
| `timeout`       | Optional       | Optional              | --                                         |
| `model_id`      | **Deprecated** | ❌ Removed             | Use `project_name` instead                 |
| `model_version` | Optional       | ❌ Removed             | No longer supported                        |
| `verbose`       | Optional       | ❌ Removed             | Use Python logging config instead          |
| `tmp_dir`       | N/A            | ✅ New                 | Temporary directory for file storage       |
| `force_http`    | N/A            | ✅ New                 | Force HTTP transport (defaults to `False`) |

### Side-by-Side Comparison

See the complete migration in action with this example showing both client initialization and logging evaluations synchronously.

#### log\_evaluations\_sync

<CodeGroup>
  ```python Version 7 theme={null}
  from arize.pandas.logger import Client

  # Client initialization
  client = Client(
      api_key="your-api-key",
      space_id="your-space-id"
  )

  # Logging evaluations (sync via gRPC)
  response = client.log_evaluations_sync(
      dataframe=evals_df,
      model_id="my-project",  # or project_name
      model_version="v1.0",   # optional
      validate=True,
      timeout=30.0,
      verbose=True,
      project_name="my-project"  # alternative to model_id
  )
  ```

  ```python Version 8 theme={null}
  from arize import ArizeClient

  # Client initialization
  client = ArizeClient(api_key="your-api-key")

  # Logging evaluations (gRPC by default)
  response = client.spans.update_evaluations(
      space_id="your-space-id",  # Now required per call
      project_name="my-project",  # Required, no model_id alternative
      dataframe=evals_df,
      validate=True,
      timeout=30.0,
      tmp_dir="/tmp/arize",  # optional, new parameter
      force_http=False  # Use gRPC like v7's log_evaluations_sync
      # verbose parameter removed
      # model_version removed
  )
  ```
</CodeGroup>

#### log\_evaluations

<CodeGroup>
  ```python Version 7 theme={null}
  from arize.pandas.logger import Client

  # Client initialization
  client = Client(
      api_key="your-api-key",
      space_id="your-space-id"
  )

  # Logging evaluations
  response = client.log_evaluations(
      dataframe=evals_df,
      model_id="my-project",  # or project_name
      model_version="v1.0",   # optional
      validate=True,
      path="/tmp/arize",
      timeout=30.0,
      verbose=True,
      project_name="my-project"  # alternative to model_id
  )
  ```

  ```python Version 8 theme={null}
  from arize import ArizeClient

  # Client initialization
  client = ArizeClient(api_key="your-api-key")

  # Logging evaluations
  response = client.spans.update_evaluations(
      space_id="your-space-id",  # Now required per call
      project_name="my-project",  # Required, no model_id alternative
      dataframe=evals_df,
      validate=True,
      tmp_dir="/tmp/arize",  # renamed from 'path'
      timeout=30.0,
      force_http=True  # Use HTTP like v7's log_evaluations
      # verbose parameter removed
      # model_version removed
  )
  ```
</CodeGroup>

## log\_annotations

The `log_annotations()` method migrates from `client.log_annotations()` to `client.spans.update_annotations()`.

### Parameter Reference

This table provides a complete mapping of all parameters between v7 and v8, including which parameters were removed, renamed, or remain unchanged.

| Parameter      | v7          | v8                    | Notes / Changes                   |
| -------------- | ----------- | --------------------- | --------------------------------- |
| `space_id`     | Client init | **Required** per call | Must pass explicitly              |
| `project_name` | Required    | Required              | --                                |
| `dataframe`    | Required    | Required              | --                                |
| `validate`     | Optional    | Optional              | --                                |
| `verbose`      | Optional    | ❌ Removed             | Use Python logging config instead |

### Side-by-Side Comparison

See the complete migration in action with this example showing both client initialization and logging annotations.

<CodeGroup>
  ```python Version 7 theme={null}
  from arize.pandas.logger import Client

  # Client initialization
  client = Client(
      api_key="your-api-key",
      space_id="your-space-id"
  )

  # Logging annotations
  response = client.log_annotations(
      dataframe=annotations_df,
      project_name="my-project",
      validate=True,
      verbose=True
  )
  ```

  ```python Version 8 theme={null}
  from arize import ArizeClient

  # Client initialization
  client = ArizeClient(api_key="your-api-key")

  # Logging annotations
  response = client.spans.update_annotations(
      space_id="your-space-id",  # Now required per call
      project_name="my-project",
      dataframe=annotations_df,
      validate=True
      # verbose parameter removed
  )
  ```
</CodeGroup>

## log\_metadata

The `log_metadata()` method migrates from `client.log_metadata()` to `client.spans.update_metadata()`.

### Parameter Reference

This table provides a complete mapping of all parameters between v7 and v8, including which parameters were removed, renamed, or remain unchanged.

| Parameter                    | v7          | v8                    | Changes                           |
| ---------------------------- | ----------- | --------------------- | --------------------------------- |
| `space_id`                   | Client init | **Required** per call | Must pass explicitly              |
| `project_name`               | Required    | Required              | --                                |
| `dataframe`                  | Required    | Required              | --                                |
| `patch_document_column_name` | Optional    | Optional              | --                                |
| `validate`                   | Optional    | Optional              | --                                |
| `verbose`                    | Optional    | ❌ Removed             | Use Python logging config instead |

### Side-by-Side Comparison

See the complete migration in action with this example showing both client initialization and logging metadata updates.

<CodeGroup>
  ```python Version 7 theme={null}
  from arize.pandas.logger import Client

  # Client initialization
  client = Client(
      api_key="your-api-key",
      space_id="your-space-id"
  )

  # Logging metadata
  response = client.log_metadata(
      dataframe=metadata_df,
      project_name="my-project",
      patch_document_column_name="patch_document",
      validate=True,
      verbose=True
  )
  ```

  ```python Version 8 theme={null}
  from arize import ArizeClient

  # Client initialization
  client = ArizeClient(api_key="your-api-key")

  # Logging metadata
  response = client.spans.update_metadata(
      space_id="your-space-id",  # Now required per call
      project_name="my-project",
      dataframe=metadata_df,
      patch_document_column_name="patch_document",
      validate=True
      # verbose parameter removed
  )
  ```
</CodeGroup>
