Skip to content

Commit

Permalink
chore: add deprecation message for launch_app port and host parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
axiomofjoy committed Mar 9, 2024
1 parent af9de12 commit 065d3cd
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/phoenix/session/session.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import logging
import os
import warnings
from abc import ABC, abstractmethod
from collections import UserList
from datetime import datetime
Expand All @@ -24,6 +25,8 @@
from phoenix.config import (
ENV_NOTEBOOK_ENV,
ENV_PHOENIX_COLLECTOR_ENDPOINT,
ENV_PHOENIX_HOST,
ENV_PHOENIX_PORT,
get_env_host,
get_env_port,
get_exported_files,
Expand Down Expand Up @@ -454,6 +457,29 @@ def launch_app(
else:
nb_env = notebook_environment

if port is not None:
warning_message = (
"❗️ The launch_app `port` parameter is deprecated and "
"will be removed in a future release. "
f"Use the `{ENV_PHOENIX_PORT}` environment variable instead."
)
print(warning_message)
warnings.warn(
warning_message,
DeprecationWarning,
)
if host is not None:
warning_message = (
"❗️ The launch_app `host` parameter is deprecated and "
"will be removed in a future release. "
f"Use the `{ENV_PHOENIX_HOST}` environment variable instead."
)
print(warning_message)
warnings.warn(
warning_message,
DeprecationWarning,
)

host = host or get_env_host()
port = port or get_env_port()

Expand Down

0 comments on commit 065d3cd

Please sign in to comment.