Skip to content

Commit

Permalink
chore(data-warehouse): add back url_pattern (#19063)
Browse files Browse the repository at this point in the history
add back url_pattern
  • Loading branch information
EDsCODE authored Dec 4, 2023
1 parent 8d41005 commit becc512
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions posthog/warehouse/api/table.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, List, Optional
from typing import Any, List

from rest_framework import filters, request, response, serializers, status, viewsets
from rest_framework.exceptions import NotAuthenticated
Expand Down Expand Up @@ -35,7 +35,6 @@ class TableSerializer(serializers.ModelSerializer):
created_by = UserBasicSerializer(read_only=True)
credential = CredentialSerializer()
columns = serializers.SerializerMethodField(read_only=True)
url_pattern = serializers.SerializerMethodField(read_only=True)
external_data_source = ExternalDataSourceSerializers(read_only=True)

class Meta:
Expand All @@ -54,9 +53,6 @@ class Meta:
]
read_only_fields = ["id", "created_by", "created_at", "columns", "external_data_source"]

def get_url_pattern(self, table: DataWarehouseTable) -> Optional[str]:
return None if table.external_data_source_id else table.url_pattern

def get_columns(self, table: DataWarehouseTable) -> List[SerializedField]:
return serialize_fields(table.hogql_definition().fields)

Expand Down

0 comments on commit becc512

Please sign in to comment.