Skip to content

Commit

Permalink
various little fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mike0sv committed Jul 11, 2024
1 parent 8c71e3b commit f605027
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@ testpaths=tests
python_classes=*Test
markers:
slow: slow tests
asyncio: async tests
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"httpx==0.24.1",
"ruff==0.3.7",
"pre-commit==3.5.0",
"pytest-asyncio==0.23.7",
],
"llm": [
"openai>=1.16.2",
Expand Down
6 changes: 3 additions & 3 deletions src/evidently/ui/components/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ class SimpleSecurity(SecurityComponent):
def get_dependencies(self, ctx: ComponentContext) -> Dict[str, Provide]:
return {
"user_id": Provide(get_user_id),
"security": Provide(self.get_security),
"security_config": Provide(lambda: self),
"auth_manager": Provide(lambda: NoopAuthManager()),
"security": Provide(self.get_security, sync_to_thread=False),
"security_config": Provide(lambda: self, sync_to_thread=False),
"auth_manager": Provide(lambda: NoopAuthManager(), sync_to_thread=False),
}


Expand Down
5 changes: 5 additions & 0 deletions src/evidently/ui/local_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ def create_logging() -> dict:
"format": "%(asctime)s %(levelname)-8s %(name)-15s %(message)s",
"datefmt": "%Y-%m-%dT%H:%M:%SZ",
},
"standard": {
"()": "logging.Formatter",
"format": "%(asctime)s %(levelname)-8s %(name)-15s %(message)s",
"datefmt": "%Y-%m-%dT%H:%M:%SZ",
},
},
"handlers": {
"default": {
Expand Down
5 changes: 4 additions & 1 deletion tests/multitest/metrics/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
from tests.multitest.metrics.conftest import metric_fixtures


def _check_dataframe(report: Report):
def _check_dataframe(report: Report, metric: Metric):
if not metric.__class__.result_type().__config__.pd_include:
# skipping not supported
return
df = report.as_dataframe()
assert isinstance(df, pd.DataFrame)

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Config:

def get_route_handlers(self, ctx: ComponentContext):
@get("/tests_setup")
def tests_setup(project_manager: ProjectManager, security: SecurityService) -> None:
async def tests_setup(project_manager: ProjectManager, security: SecurityService) -> None:
self.app.state["pm"] = project_manager
self.app.state["security"] = security

Expand Down

0 comments on commit f605027

Please sign in to comment.