Get a datasource by account and container Parameters ---------- account : str The account name. container : str The container name. Returns ------- DataSource The datasource.
(account, container)
| 15 | |
| 16 | |
| 17 | async def get(account, container) -> DataSource | None: |
| 18 | """ |
| 19 | Get a datasource by account and container |
| 20 | |
| 21 | Parameters |
| 22 | ---------- |
| 23 | account : str |
| 24 | The account name. |
| 25 | container : str |
| 26 | The container name. |
| 27 | |
| 28 | Returns |
| 29 | ------- |
| 30 | DataSource |
| 31 | The datasource. |
| 32 | """ |
| 33 | datasource_collection: AgnosticCollection = collection() |
| 34 | datasource = await datasource_collection.find_one( |
| 35 | {"account": account, "container": container} |
| 36 | ) |
| 37 | if datasource is None: |
| 38 | return None |
| 39 | return DataSource(**datasource) |
| 40 | |
| 41 | |
| 42 | async def datasource_exists(account, container) -> bool: |
no test coverage detected