Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APi End point : Display a Table schema #1659

Closed
4 of 5 tasks
Tracked by #1593
Assignees

Comments

@PriyaBasker23
Copy link
Contributor

PriyaBasker23 commented Sep 26, 2023

The scope of the ticket would be to create a api end point for display table schema with path parameter based on the document below

https://dsdmoj.atlassian.net/wiki/spaces/DataPlatform/pages/4511991882/Initial+APIs

The end point should be /{data-product-name}/{table-schema-name}/ see API doc above

Checklist

  • add code to terraform module for api infrastructure
  • create a lambda for displaying the table schema

Definition of Done

  • Able to display the schema for the table requested in a particular data product
  • unit test changed or implemented as per new change
  • smoke test implemented ( if possible)
@murdo-moj
Copy link
Contributor

murdo-moj commented Sep 28, 2023

Dependency on create a table schema #1194

@MatMoore
Copy link
Contributor

MatMoore commented Oct 5, 2023

I'm going to start mocking up the lambda & unit tests while I wait for #1194

This could be delivered in parallel, it's just we need example schemas in the bucket to be able to test it properly.

@MatMoore
Copy link
Contributor

MatMoore commented Oct 5, 2023

Swagger config will be something like this:

    "/data-product/{data-product-name}/table/{table-name}/schema": {
      "get": {
        "tags": [
          "get_schema"
        ],
        "summary": "Get the latest schema for a table.",
        "description": "Returns a json object describing the table.",
        "operationId": "getSchema",
        "parameters": [
          {
            "in": "path",
            "name": "data-product-name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "table-name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "authorizationToken",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "successful operation, response format https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/glue/client/get_table.html",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Data product or table schema not found"
          }
        }
      }
    },

might want to provide an example of the success response as well

@MatMoore
Copy link
Contributor

MatMoore commented Oct 5, 2023

@MatMoore MatMoore moved this from 🧐 To Do to 💨 In Progress in Analytical Platform Oct 5, 2023
@MatMoore
Copy link
Contributor

MatMoore commented Oct 5, 2023

Note: when the new endpoint is deployed, we can remove the get glue data endpoint.

@tom-webber
Copy link
Contributor

@tom-webber tom-webber moved this from ✨ Done ✨ to 💨 In Progress in Analytical Platform Oct 18, 2023
@tom-webber tom-webber reopened this Oct 18, 2023
tom-webber added a commit that referenced this issue Oct 18, 2023
add format_table_schema function to base schema
get_schema lambda returns reformatted schema
tweak get_schema tests
tom-webber added a commit that referenced this issue Oct 19, 2023
* resolves #1659
* add format_table_schema function to base schema
* get_schema lambda returns reformatted schema
* tweak get_schema tests
* Update data_product_metadata.py
* remove owner and retention from original schema format
* update docs with get schema endpoint
* rename table schema component
@github-project-automation github-project-automation bot moved this from 💨 In Progress to ✨ Done ✨ in Analytical Platform Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment