-
Notifications
You must be signed in to change notification settings - Fork 771
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
[sm] Add data exporter for ClickHouse in mdx file #4061
[sm] Add data exporter for ClickHouse in mdx file #4061
Conversation
e515573
to
f58b835
Compare
Specify your configuration settings in 'io_config.yaml'. | ||
|
||
""" | ||
database = 'database_name' # Specify the name of the schema to export data to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using mage secrets to store this, for this example?
from mage_ai.data_preparation.decorators import data_exporter | ||
|
||
|
||
class ClickHouse(ClickHouseParent): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need to add this class if there's no customized logic in enter and exit methods.
Just do
ClickHouse.with_config(ConfigFileLoader(config_path, config_profile)).export(
....
)
in the method below
f58b835
to
a79f615
Compare
config_path = path.join(get_repo_path(), 'io_config.yaml') | ||
config_profile = 'default' | ||
|
||
with ClickHouse.with_config(ConfigFileLoader(config_path, config_profile)) as loader: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean you don't need with
statement.
just do
ClickHouse.with_config(ConfigFileLoader(config_path, config_profile)).export(
...
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it!
a79f615
to
fe51e87
Compare
Description
Add data exporter for ClickHouse in mdx file
Related Slack thread: https://mageai.slack.com/archives/C03HTTWFEKE/p1700653736340409
How Has This Been Tested?
Checklist
docs/mint.json
cc: