Skip to content

Commit 681a0f8

Browse files
longshuicytcnicholmax-zillaarunapa
authored
491 beanie for metadata, dataset_metadata (#493)
* import container (#462) * 446 gui to manage api keys (#465) * add new routes placeholder * add list and delete endpoint; inline docs * codegen and pytest * ugly ui? * onstart clear user keys * delete works but pytest doesn't work yet * pytest all works * codegen * redux * reducer and types * write the table * correctly wire in the apikey and error handling * wire in the delete modal of apikeys * wire in the creation api key * everything working in the gui * formatting --------- Co-authored-by: toddn <[email protected]> * Sharing tab cleanup (#430) * fix bug where users not being fetched * simplifying role query pt 1 * refactor tables and API calls * cleanup * start moving GroupAndRole to separate table * add expanding sub table * remove AddGroup buttons for now * formatting * codegen * add response model * codegen * remove container * fix bug with Roles return object and autocomplete on groups * codegen * Fix reload bug (#451) * 461 fix library version in pipfile (#468) * fix pipfile version * regenerate the piplock file * 443 frontend need to display more verbose backend error (#458) * Updated frontend error message to be more verbose * Backend returns verbose logs, frontend displays it as generic messages depending on the HTTP status code * Updated the error message logic to include original backend logs wherever possible * Fixed report button issue * Rootcause: The onClick event for the report button has a semantic error, which is causing the issue reason string to be replaced with an object * Also added encode for the reason * Fixing issue with error message * Revert "Updated frontend error message to be more verbose" This reverts commit 7d230d3. * Fixing issue with error message * 469 create profile page (#471) * profile page exists * new route for user profile profile page includes layout * codegen new route for get current user profile * we now get the profile, but nothing shows yet * page has fake data * we see the profile now * formatting * Implemented role delete in sharing tab (#472) * Tested by deleting a user, group. Verified entry is removed upon refresh * Show Creator on Group Page (#428) * the owner is visible, and we cannot change the owner in the table * showing group creator on top * creator link is wrong, need to fix * bold text for word 'creator' * using more conditionals to reduce duplicate code * missing modal added creator name matches other names --------- Co-authored-by: Chen Wang <[email protected]> * Fixed bug where error detail might be empty (#478) * Fixed bug where error detail might be empty * Added null check to the detail string to prevent errors when detail is not set * Second check to validate the body field * authorization deps * update models * refactoring the metadata route * include in main * mongoout pattern * black * see if this new query pattern works * metadata datasets * finish metadata dataset and metadata file * remove _beanie database * codegen * new pattern of matching id * fix typo * get/post works * more fixes * fix deleting endpoint * fix patch endpoint * fix put metadata * try max's style to minimize merge conflict --------- Co-authored-by: toddn <[email protected]> Co-authored-by: Max Burnette <[email protected]> Co-authored-by: Aruna Parameswaran <[email protected]> Co-authored-by: Todd Nicholson <[email protected]>
1 parent 45776d9 commit 681a0f8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3426
-2049
lines changed

backend/Pipfile

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,35 @@ verify_ssl = true
44
name = "pypi"
55

66
[packages]
7-
fastapi = "*"
8-
uvicorn = "*"
9-
motor = "*"
10-
mongoengine = "*"
11-
beanie = "*"
12-
passlib = "*"
13-
bcrypt = "*"
14-
pyjwt = "*"
15-
minio = "*"
16-
python-multipart = "*"
17-
pipfile = "*"
18-
email-validator = "*"
19-
python-keycloak = "*"
20-
pika = "*"
21-
aio-pika = "*"
22-
elasticsearch = "*"
23-
pipenv = "*"
24-
install = "*"
25-
rocrate = "*"
26-
httpx = "*"
27-
packaging = "*"
28-
itsdangerous = "*"
7+
fastapi = "0.95.1"
8+
uvicorn = "0.21.1"
9+
motor = "3.1.2"
10+
mongoengine = "0.27.0"
11+
beanie = "1.18.0"
12+
passlib = "1.7.4"
13+
bcrypt = "4.0.1"
14+
pyjwt = "2.6.0"
15+
minio = "7.1.14"
16+
python-multipart = "0.0.6"
17+
pipfile = "0.0.2"
18+
email-validator = "2.0.0.post2"
19+
python-keycloak = "2.15.3"
20+
pika = "1.3.1"
21+
aio-pika = "9.0.5"
22+
elasticsearch = "8.7.0"
23+
pipenv = "2023.4.20"
24+
install = "1.3.5"
25+
rocrate = "0.7.0"
26+
httpx = "0.24.0"
27+
packaging = "23.1"
28+
itsdangerous = "2.1.2"
2929

3030
[dev-packages]
31-
requests = "*"
32-
pytest = "*"
33-
pytest-asyncio = "*"
34-
black = "*"
35-
faker = "*"
31+
requests = "2.28.2"
32+
pytest = "7.3.1"
33+
pytest-asyncio = "0.21.0"
34+
black = "23.3.0"
35+
faker = "18.4.0"
3636

3737
[requires]
3838
python_version = "3.9"

backend/Pipfile.lock

Lines changed: 95 additions & 95 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/app/beanie_views_test.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ class Category(BaseModel):
1818

1919

2020
class Product(Document):
21-
name: str # You can use normal types just like in pydantic
21+
name: str # You can use normal types just like in pydantic
2222
description: Optional[str] = None
23-
price: Indexed(float) # You can also specify that a field should correspond to an index
24-
category: Category # You can include pydantic models as well
23+
price: Indexed(
24+
float
25+
) # You can also specify that a field should correspond to an index
26+
category: Category # You can include pydantic models as well
2527

2628

2729
class Bike(Document):
@@ -42,7 +44,7 @@ class Settings:
4244
"$group": {
4345
"_id": "$type",
4446
"number": {"$sum": 1},
45-
"new": {"$sum": {"$cond": ["$is_new", 1, 0]}}
47+
"new": {"$sum": {"$cond": ["$is_new", 1, 0]}},
4648
}
4749
},
4850
]
@@ -55,7 +57,11 @@ async def example():
5557

5658
# Initialize beanie with the Product document class
5759
# await init_beanie(database=client.beanie, document_models=[Product, Bike, Metrics, DatasetDBViewList], recreate_views=True,)
58-
await init_beanie(database=client.clowder2, document_models=[DatasetDB, DatasetDBViewList, AuthorizationDB], recreate_views=True,)
60+
await init_beanie(
61+
database=client.clowder2,
62+
document_models=[DatasetDB, DatasetDBViewList, AuthorizationDB],
63+
recreate_views=True,
64+
)
5965

6066
# chocolate = Category(name="Chocolate", description="A preparation of roasted and ground cacao seeds.")
6167
# # Beanie documents work just like pydantic models
@@ -78,8 +84,11 @@ async def example():
7884
# results = await Metrics.find(Metrics.type == "Road").to_list()
7985
# print(results)
8086

81-
results = await DatasetDBViewList.find(DatasetDBViewList.author.email == "[email protected]").to_list()
87+
results = await DatasetDBViewList.find(
88+
DatasetDBViewList.author.email == "[email protected]"
89+
).to_list()
8290
print(results)
8391

92+
8493
if __name__ == "__main__":
85-
asyncio.run(example())
94+
asyncio.run(example())

0 commit comments

Comments
 (0)