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

Meta info api #502

Merged
merged 36 commits into from Dec 24, 2021
Merged

Meta info api #502

merged 36 commits into from Dec 24, 2021

Conversation

kshitij123456
Copy link
Contributor

@kshitij123456 kshitij123456 commented Dec 14, 2021

  • Added the new refactored API for fetching the meta information of any database or data warehouse
  • Add the schema support for the DB/DW (wherever applicable)
  • Added the new field for the DB/DW schema and corresponding migration script
  • Incorporated the schema related changes in the data loader class.

kshitij123456 and others added 2 commits December 14, 2021 20:57
- This file contains the configuration pertaining to the schema
  availability of various databases
- It also contains configuration pertaining to the views and
  materialized views availability of various databases
- get_schema_availability: to check if the datasource supports schemas
- list_schemas: to get the list of schemas belonging to a particular datasource
- list_tables: to get the list of tables belonging to a particular schema
@netlify
Copy link

netlify bot commented Dec 14, 2021

✔️ Deploy Preview for frontend-sb canceled.

🔨 Explore the source changes: cd2d954

🔍 Inspect the deploy log: https://app.netlify.com/sites/frontend-sb/deploys/61c59ece97ffc000076b8c6f

kshitij123456 and others added 7 commits December 14, 2021 23:08
- views-available: returns a boolean signifying if a database
  supports views
- materialize-views-available: returns a boolean signifying
  if a database supports materialize views
- list-views: returns list of views in a schema of a
  database
- merge the views availability and materialize_views
  availability endpoints into a single API endpoint

return jsonify({"message":message, "status":status, "view_names":view_names})

@blueprint.route("/table-info",methods=["GET"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@blueprint.route("/table-info",methods=["GET"])
@blueprint.route("/table-info",methods=["POST"])

chaos_genius/views/data_source_view.py Show resolved Hide resolved
chaos_genius/views/data_source_view.py Outdated Show resolved Hide resolved
chaos_genius/views/data_source_view.py Outdated Show resolved Hide resolved
chaos_genius/views/data_source_view.py Outdated Show resolved Hide resolved
chaos_genius/views/data_source_view.py Outdated Show resolved Hide resolved
chaos_genius/views/data_source_view.py Outdated Show resolved Hide resolved
chaos_genius/views/data_source_view.py Outdated Show resolved Hide resolved
chaos_genius/views/data_source_view.py Outdated Show resolved Hide resolved
chaos_genius/views/data_source_view.py Outdated Show resolved Hide resolved
kshitij123456 and others added 5 commits December 16, 2021 16:48
- two endpoints, one of them returning schema availability and the
  second returning views and materialize views availability have been
  merged into one
Created a helper fucntion in `connectors/__init__.py`
which returns table data as a Dictionary.

Changed table-info API to use the new helper function.
Validated if datasource exists correspodin to the provided id.

fixed minor bug in error handling.
kshitij123456 and others added 5 commits December 17, 2021 12:47
- The api endpoint ("/list-schema") to get the list of schemas
  was modified
- The api endpoint ("/get-table-list") to get the list of tables
  in a schema was modified
- The api endpoint ("/get-view-list") to get the list of views
  and materialized views was modified
Set the schema to None in table-into API in the case BigQuery is
the datasource type.
chaos_genius/views/data_source_view.py Outdated Show resolved Hide resolved
chaos_genius/views/data_source_view.py Outdated Show resolved Hide resolved
chaos_genius/views/data_source_view.py Outdated Show resolved Hide resolved
chaos_genius/views/data_source_view.py Outdated Show resolved Hide resolved
chaos_genius/views/data_source_view.py Outdated Show resolved Hide resolved
chaos_genius/views/data_source_view.py Outdated Show resolved Hide resolved
chaos_genius/views/data_source_view.py Outdated Show resolved Hide resolved
chaos_genius/views/data_source_view.py Outdated Show resolved Hide resolved
chaos_genius/views/data_source_view.py Outdated Show resolved Hide resolved
chaos_genius/views/data_source_view.py Outdated Show resolved Hide resolved
bhargavsk1077 and others added 6 commits December 21, 2021 18:01
Added schema name such that `_get_table_name` returns
'schema_name.table_name' for KPIs where schemas are present.
and 'table_name' when schema is None.

Used `get_datasource_data_from_id` instead of the DataSource Model
to fetch datasource info.
- schema_name was also added to as_dict and safe_dict in KPI model
- safe_dict was being returned by get_datasource_data_from_id,
  because of which certain keys which were required were not
  available
Added schema_name while creating a KPI object in Kpi View.

Added schema_name in as_dict and safe_dict methods in Kpi Model.
- the changes were done in kpi_model.py file
@kshitij123456 kshitij123456 added the don't merge PR which doesn't need to be merged right now label Dec 24, 2021
@manassolanki manassolanki force-pushed the api-meta-info branch 2 times, most recently from 64d6238 to cd5b456 Compare December 24, 2021 10:16
@manassolanki manassolanki merged commit 8e82882 into main Dec 24, 2021
@manassolanki manassolanki added ✨ enhancement New feature or request and removed don't merge PR which doesn't need to be merged right now labels Jan 4, 2022
@Samyak2 Samyak2 added this to the v0.3.0 milestone Jan 4, 2022
@Samyak2 Samyak2 deleted the api-meta-info branch February 14, 2022 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants