|
16 | 16 | # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
17 | 17 | # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
18 | 18 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
19 | | -import os |
20 | 19 | import logging |
21 | 20 | from typing import Any, List, Optional, Dict |
22 | 21 | from concurrent import futures |
|
32 | 31 | from sqlalchemy.sql.expression import TextClause |
33 | 32 |
|
34 | 33 | from google.cloud import firestore_admin_v1 |
35 | | -from google.cloud.firestore_admin_v1.types import ListDatabasesResponse, Database |
| 34 | +from google.cloud.firestore_admin_v1.types import Database |
36 | 35 | from google.oauth2 import service_account |
37 | 36 |
|
38 | 37 | logger = logging.getLogger('sqlalchemy.dialects.CloudDatastore') |
@@ -483,14 +482,14 @@ def get_columns(self, connection: Connection, table_name: str, schema: str | Non |
483 | 482 | credentials_base64=self.credentials_base64, |
484 | 483 | database=schema |
485 | 484 | ) |
486 | | - ancestor_key = client.key("__kind__", table_name) |
487 | | - query = client.query(kind="__property__", ancestor=ancestor_key) |
| 485 | + query = client.query(kind="__Stat_PropertyType_PropertyName_Kind__") |
| 486 | + query.add_filter("kind_name", "=", table_name) |
488 | 487 | properties = list(query.fetch()) |
489 | 488 |
|
490 | 489 | def process_property(property): |
491 | 490 | return { |
492 | | - "name": property.key.name, |
493 | | - "type": _types.STRING, # TODO:Change to other type |
| 491 | + "name": property["property_name"], |
| 492 | + "type": _types._property_type[property["property_type"]], |
494 | 493 | "nullable": True, |
495 | 494 | "comment": "", |
496 | 495 | "default": None, |
|
0 commit comments