Skip to content

Commit 0411e5a

Browse files
committed
fix python 3.9 version of importlib
Signed-off-by: Danny Chiao <danny@tecton.ai>
1 parent 813c420 commit 0411e5a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

sdk/python/feast/ui_server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import json
22
import threading
3+
from importlib import resources
34
from typing import Callable, Optional
45

56
import uvicorn
67
from fastapi import FastAPI, Response
78
from fastapi.middleware.cors import CORSMiddleware
89
from fastapi.staticfiles import StaticFiles
9-
from importlib_resources import as_file, files
1010

1111
import feast
1212

@@ -53,7 +53,7 @@ def shutdown_event():
5353

5454
async_refresh()
5555

56-
ui_dir = files(__package__).joinpath("ui/build/")
56+
ui_dir = resources.files(__package__).joinpath("ui/build/")
5757
# Initialize with the projects-list.json file
5858
with ui_dir.joinpath("projects-list.json").open(mode="w") as f:
5959
projects_dict = {
@@ -82,7 +82,7 @@ def catch_all():
8282

8383
return Response(content, media_type="text/html")
8484

85-
with as_file(ui_dir) as react_app_dir:
85+
with resources.as_file(ui_dir) as react_app_dir:
8686
app.mount(
8787
"/", StaticFiles(directory=react_app_dir, html=True), name="site",
8888
)

0 commit comments

Comments
 (0)