|
326 | 326 | " bytes bytea;\n", |
327 | 327 | " BEGIN\n", |
328 | 328 | " bytes := uuid_send(uuid);\n", |
| 329 | + " if (get_byte(bytes, 6) >> 4)::int2 != 1 then\n", |
| 330 | + " RAISE EXCEPTION 'UUID version is not 1';\n", |
| 331 | + " end if;\n", |
329 | 332 | " RETURN to_timestamp(\n", |
330 | 333 | " (\n", |
331 | 334 | " (\n", |
|
647 | 650 | " return rec == None\n", |
648 | 651 | "\n", |
649 | 652 | " def munge_record(self, records) -> Iterable[Tuple[uuid.UUID, str, str, List[float]]]:\n", |
650 | | - " if self.time_partition_interval is not None:\n", |
651 | | - " for record in records:\n", |
652 | | - " id = record[0]\n", |
653 | | - " if id.variant != uuid.RFC_4122 or id.version != 1:\n", |
654 | | - " raise ValueError(\"When using time partitioning, id must be a v1 uuid\")\n", |
655 | | - "\n", |
656 | 653 | " metadata_is_dict = isinstance(records[0][1], dict)\n", |
657 | 654 | " if metadata_is_dict:\n", |
658 | 655 | " records = map(lambda item: Async._convert_record_meta_to_json(item), records)\n", |
|
895 | 892 | "execution_count": null, |
896 | 893 | "metadata": {}, |
897 | 894 | "outputs": [ |
898 | | - { |
899 | | - "name": "stderr", |
900 | | - "output_type": "stream", |
901 | | - "text": [ |
902 | | - "/Users/cevian/.pyenv/versions/3.11.4/envs/nbdev_env/lib/python3.11/site-packages/fastcore/docscrape.py:225: UserWarning: potentially wrong underline length... \n", |
903 | | - "Returns \n", |
904 | | - "-------- in \n", |
905 | | - "Retrieves similar records using a similarity query.\n", |
906 | | - "...\n", |
907 | | - " else: warn(msg)\n" |
908 | | - ] |
909 | | - }, |
910 | 895 | { |
911 | 896 | "data": { |
912 | 897 | "text/markdown": [ |
|
1319 | 1304 | " return rec == None\n", |
1320 | 1305 | " \n", |
1321 | 1306 | " def munge_record(self, records) -> Iterable[Tuple[uuid.UUID, str, str, List[float]]]:\n", |
1322 | | - " if self.time_partition_interval is not None:\n", |
1323 | | - " for record in records:\n", |
1324 | | - " id = record[0]\n", |
1325 | | - " if id.variant != uuid.RFC_4122 or id.version != 1:\n", |
1326 | | - " raise ValueError(\"When using time partitioning, id must be a v1 uuid\")\n", |
1327 | | - "\n", |
1328 | 1307 | " metadata_is_dict = isinstance(records[0][1], dict)\n", |
1329 | 1308 | " if metadata_is_dict:\n", |
1330 | 1309 | " records = map(lambda item: Sync._convert_record_meta_to_json(item), records)\n", |
|
0 commit comments