Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Simplify: Remove unused code & mixins #753

Merged
merged 3 commits into from
Oct 25, 2023
Merged

Simplify: Remove unused code & mixins #753

merged 3 commits into from
Oct 25, 2023

Conversation

nolar
Copy link
Collaborator

@nolar nolar commented Oct 25, 2023

Little improvements step by step:

Random sampling & time traveling AST nodes, methods and mixins are not used in the codebase at all. We can safely remove them. When and if needed, we will restore and reimplement them.

The schema fetching is a bit more complicated: there are 2 schema fetching logics in the code. The one that is actually used is Database.select_table_schema() & Database.query_table_schema(). The one in the mixins (list_tables() & table_information()) is unused. Hence, we can remove it too.

On a matter of whether we want to move the schema fetching from databases to dialects: probably not. Some databases can expose their schemas via non-SQL APIs, such as HTTP API, so it should remain in the database. The dialect should only do the SQL rendering. If we would like to generalize it, we will do this later anew.

On a side note: The split of Databases & Dialects is also conditional, only for simplicity of testing the SQL rendering without real connection to the database, and vice versa. There would be no much problem in merging the paired classes or their methods if needed.

The schemas are currently fetching via `Database.select_table_schema()` & `Database.query_table_schema()`, so this dialectic code is unused.

It is also questionable that the schema fetching must be done via dialects at all: some databases can provide an API (e.g. HTTP API) to fetch the database metadata, such as Databricks. So it belongs to the database, not to dialects.
@dlawin dlawin merged commit 038cf17 into master Oct 25, 2023
6 checks passed
@dlawin dlawin deleted the remove-unused-mixins branch October 25, 2023 16:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants