Data source class for populating select parameter options from a database table or query.This class can be imported from the squirrels.data_sources or the squirrels module.
Either the name of the table to use, or a SQL query to run. If using a SQL query, it must start with “SELECT” (ignoring case and leading whitespaces) followed by a whitespace.The available tables are based on the source argument. If the source is SourceEnum.CONNECTION, then the SQL syntax is based on the underlying database from the connection argument. Otherwise, the SQL syntax is DuckDB SQL.
The column name that indicates which options are selected by default. Should contain 1 for default options and 0 otherwise. If None, no options are selected by default.If more than one option has a value of 1 in this column, then the first option with a value of 1 will be selected.
Dictionary mapping custom field names to column names. Unlike the custom_fields argument in SelectParameterOption, the dictionary value is the column name storing the custom field values instead of the custom field values themselves.
Name of the connection to use. Only used if the source is SourceEnum.CONNECTION. Connection must be defined in squirrels.yml or the connections.py file.If None, uses the default connection (specified by SQRL_CONNECTIONS__DEFAULT_NAME_USED environment variable or ‘default’).
A SelectDataSource object is created in the pyconfigs/parameters.py file. It must be created in a function decorated with the create_from_source factory method from SingleSelectParameter or MultiSelectParameter.
from squirrels import parameters as p, data_sources as ds@p.SingleSelectParameter.create_from_source( name="product_category", label="Product Category", description="Select a product category")def product_category_source(): return ds.SelectDataSource( table_or_query=""" SELECT category_id AS id, category_name AS name, sort_order FROM product_categories """, id_col="id", options_col="name", order_by_col="sort_order" )
In addition, the following are some additional examples for creating a SelectDataSource object.
This example marks certain options as selected by default using a column that contains 1 or 0.
ds.SelectDataSource( table_or_query=""" SELECT region_id, region_name, (CASE WHEN is_top_choice = 'y' THEN 1 ELSE 0 END) AS is_default FROM regions """, id_col="region_id", options_col="region_name", is_default_col="is_default")
Enabling cascading effects with a parent parameter
In this example, the available product options are filtered based on the selected value of another parameter called “product_category”.
@p.SingleSelectParameter.create_from_source( name="product", label="Product", description="Select a product from the chosen category", parent_name="product_category")def product_source(): return ds.SelectDataSource( table_or_query=""" SELECT product_id, product_name, category_id, price FROM products ORDER BY product_name """, id_col="product_id", options_col="product_name", parent_id_col="category_id" # Cascades based on category selection )
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Squirrels Docs","colors":{"primary":"#B85707","light":"#EF9750","dark":"#9B4907"},"logo":{"light":"https://mintcdn.com/squirrels/kzLxoqeVmuUz8Q-T/images/logo/light.svg?fit=max\u0026auto=format\u0026n=kzLxoqeVmuUz8Q-T\u0026q=85\u0026s=d41cdc5597d9b7eebba9bb463f096f13","dark":"https://mintcdn.com/squirrels/kzLxoqeVmuUz8Q-T/images/logo/dark.svg?fit=max\u0026auto=format\u0026n=kzLxoqeVmuUz8Q-T\u0026q=85\u0026s=3d943a615801d6adedb350645121d13c"},"favicon":"/images/logo/main.svg","navbar":{"links":[{"label":"Support","href":"mailto:support@pysquirrels.com"}],"primary":{"type":"button","label":"GitHub","href":"https://github.com/squirrels-analytics/squirrels"}},"footer":{"socials":{"github":"https://github.com/squirrels-analytics/squirrels"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"]},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"squirrels","hasAudioNarration":false,"actualSubdomain":"squirrels","customDomains":["docs.pysquirrels.com"],"gitSource":{"type":"github","owner":"squirrels-analytics","repo":"squirrels-docs","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6a21e8e6bd0a90f91cb49fad","collectionId":"66b2804e-2ab5-4098-a17d-9ed84140e44f","schemaVersion":"v2"},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6a21e8e6bd0a90f91cb49fad:success","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"default","tag":"References","count":54},{"language":"default","tag":"Python reference","count":45},{"language":"default","tag":"Documentation","count":24},{"language":"default","tag":"Project files","count":14},{"language":"default","tag":"CLI reference","count":9},{"language":"default","tag":"CLI commands","count":8},{"language":"default","tag":"types","count":8},{"language":"default","tag":"Concepts","count":7},{"language":"default","tag":"arguments","count":7},{"language":"default","tag":"data_sources","count":7}]},"assistantConfig":{"enableAskAiButton":true,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":".home-page{max-width:1000px;margin:0 auto;padding:0 24px 80px}.home-section-title,.home-title{text-align:left;margin-bottom:24px}.home-title{margin-top:24px;font-size:3rem;color:#555}.dark .home-title{color:#fff}.home-section-title{margin-top:48px;font-size:2rem}.dark .home-section-title{color:#eee}.home-description{text-align:left;font-size:1.25rem;max-width:700px;margin-left:auto;margin-right:auto}.dark .home-description{color:#ddd}.card:not(:hover){border-color:#bbb}.home-hero{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-top:24px;align-items:start}.home-hero-right pre{margin:0}.home-terminal{border:1px solid #e5e7eb;border-radius:10px;overflow:hidden;background:#f8fafc}.dark .home-terminal{border-color:#374151;background:#0b1222}.home-terminal-header{display:flex;align-items:center;gap:8px;height:34px;padding:0 10px;background:#eef2f7;border-bottom:1px solid #e5e7eb}.dark .home-terminal-header{background:#555;border-bottom-color:#424242}.home-terminal-dot{width:10px;height:10px;border-radius:50%;display:inline-block}.home-terminal-dot--red{background:#ff5f56}.home-terminal-dot--yellow{background:#ffbd2e}.home-terminal-dot--green{background:#27c93f}.home-terminal-title{margin-left:auto;font-size:.85rem;color:#6b7280}.dark .home-terminal-title{color:#c7c7c7}.home-code{overflow:auto;padding:16px 20px;background:#f5f7fa;border:1px solid #e5e7eb;font-size:.95rem;line-height:1.6}.dark .home-code{background:#444;border-color:#424242}.home-hero-left .home-description{margin-left:0;margin-right:0}.home-code .comment{color:#6a9955}.home-code .command{color:#569cd6;font-weight:700}.home-code .command::before{content:\"$ \";color:#888;font-weight:400}.home-get-started-btn{display:inline-block;margin-top:24px;padding:12px 32px;background-color:#9b4907;color:#fff;text-decoration:none;border-radius:8px;font-weight:600;font-size:16px;transition:background-color .2s}@media (max-width:650px){.home-hero{grid-template-columns:1fr}}"}],"page":{"pagePath":"references/python/data_sources/selectdatasource","slug":"/references/python/data_sources/selectdatasource","pageMetadata":{"title":"SelectDataSource","tag":"class","description":"Lookup table for select parameter options","href":"/references/python/data_sources/selectdatasource","hidden":false},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Lookup table for select parameter options\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Data source class for populating select parameter options from a database table or query.`}),`\n`,_jsxs(_components.p,{children:[`This class can be imported from the `,_jsx(_components.code,{children:`squirrels.data_sources`}),` or the `,_jsx(_components.code,{children:`squirrels`}),` module.`]}),`\n`,_jsx(Heading,{level:`2`,id:`constructor`,children:`Constructor`}),`\n`,_jsxs(_components.p,{children:[`Creates a `,_jsx(_components.code,{children:`SelectDataSource`}),` object.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` __init__`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` self`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`table_or_query`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id_col`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`options_col`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` *`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`order_by_col`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` None`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` None`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`is_default_col`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` None`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` None`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` custom_cols`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: dict[`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {}, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`source`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: SourceEnum `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` SourceEnum.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`CONNECTION`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` user_group_col`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` None`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` None`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`parent_id_col`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` None`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` None`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` connection`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`str`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` None`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` None`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) -> `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`None`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`]})})}),`\n`,_jsxs(Expandable,{title:`arguments`,defaultOpen:true,children:[_jsxs(ResponseField,{name:`table_or_query`,type:`str`,required:true,id:`param-table-or-query`,children:[_jsx(_components.p,{children:`Either the name of the table to use, or a SQL query to run. If using a SQL query, it must start with “SELECT” (ignoring case and leading whitespaces) followed by a whitespace.`}),_jsxs(_components.p,{children:[`The available tables are based on the `,_jsx(_components.code,{children:`source`}),` argument. If the source is `,_jsx(_components.code,{children:`SourceEnum.CONNECTION`}),`, then the SQL syntax is based on the underlying database from the `,_jsx(_components.code,{children:`connection`}),` argument. Otherwise, the SQL syntax is DuckDB SQL.`]})]}),_jsx(ResponseField,{name:`id_col`,type:`str`,required:true,id:`param-id-col`,children:_jsx(_components.p,{children:`The column name for the option ID. Each row represents a selectable option.`})}),_jsx(ResponseField,{name:`options_col`,type:`str`,required:true,id:`param-options-col`,children:_jsx(_components.p,{children:`The column name for the display text of each option.`})}),_jsx(ResponseField,{name:`order_by_col`,type:`str | None`,default:`None`,id:`param-order-by-col`,children:_jsxs(_components.p,{children:[`The column name to order the options by. If None, orders by `,_jsx(_components.code,{children:`id_col`}),`.`]})}),_jsxs(ResponseField,{name:`is_default_col`,type:`str | None`,default:`None`,id:`param-is-default-col`,children:[_jsx(_components.p,{children:`The column name that indicates which options are selected by default. Should contain 1 for default options and 0 otherwise. If None, no options are selected by default.`}),_jsx(_components.p,{children:`If more than one option has a value of 1 in this column, then the first option with a value of 1 will be selected.`})]}),_jsx(ResponseField,{name:`custom_cols`,type:`dict[str, str]`,default:`{}`,id:`param-custom-cols`,children:_jsxs(_components.p,{children:[`Dictionary mapping custom field names to column names. Unlike the `,_jsx(_components.code,{children:`custom_fields`}),` argument in `,_jsx(_components.a,{href:`/references/python/parameter_options/selectparameteroption`,children:`SelectParameterOption`}),`, the dictionary value is the column name storing the custom field values instead of the custom field values themselves.`]})}),_jsx(ResponseField,{name:`source`,type:`SourceEnum`,default:`SourceEnum.CONNECTION`,id:`param-source`,children:_jsxs(_components.p,{children:[`The source to fetch data from as a `,_jsx(_components.a,{href:`/references/python/data_sources/sourceenum`,children:`SourceEnum`}),` value.`]})}),_jsx(ResponseField,{name:`user_group_col`,type:`str | None`,default:`None`,id:`param-user-group-col`,children:_jsx(_components.p,{children:`The column name of the user group for option visibility. If None, all users will see all options.`})}),_jsxs(ResponseField,{name:`parent_id_col`,type:`str | None`,default:`None`,id:`param-parent-id-col`,children:[_jsx(_components.p,{children:`The column name of the parent option id for cascading.`}),_jsx(_components.p,{children:`If None, then this parameter has no parent and its options will not be cascaded.`})]}),_jsxs(ResponseField,{name:`connection`,type:`str | None`,default:`None`,id:`param-connection`,children:[_jsxs(_components.p,{children:[`Name of the connection to use. Only used if the source is `,_jsx(_components.code,{children:`SourceEnum.CONNECTION`}),`. Connection must be defined in `,_jsx(_components.code,{children:`squirrels.yml`}),` or the `,_jsx(_components.code,{children:`connections.py`}),` file.`]}),_jsxs(_components.p,{children:[`If None, uses the default connection (specified by `,_jsx(_components.code,{children:`SQRL_CONNECTIONS__DEFAULT_NAME_USED`}),` environment variable or ‘default’).`]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`examples`,children:`Examples`}),`\n`,_jsxs(_components.p,{children:[`A `,_jsx(_components.code,{children:`SelectDataSource`}),` object is created in the `,_jsx(_components.code,{children:`pyconfigs/parameters.py`}),` file. It must be created in a function decorated with the `,_jsx(_components.code,{children:`create_from_source`}),` factory method from `,_jsx(_components.a,{href:`/references/python/parameters/singleselectparameter`,children:`SingleSelectParameter`}),` or `,_jsx(_components.a,{href:`/references/python/parameters/multiselectparameter`,children:`MultiSelectParameter`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`usage-example-in-parameters-py`,children:`Usage example in parameters.py`}),`\n`,_jsx(CodeBlock,{filename:``,highlight:`[9,10,11,12,13,14,15,16,17,18,19,20]`,numberOfLines:`20`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`20`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` squirrels `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` parameters `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` p, data_sources `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ds`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`@p.SingleSelectParameter.create_from_source`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"product_category\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` label`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Product Category\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` description`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Select a product category\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` product_category_source`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`():`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ds.SelectDataSource(`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` table_or_query`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"\"`})]}),`\n`,_jsx(_components.span,{className:`line line-highlight`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` SELECT `})}),`\n`,_jsx(_components.span,{className:`line line-highlight`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` category_id AS id,`})}),`\n`,_jsx(_components.span,{className:`line line-highlight`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` category_name AS name,`})}),`\n`,_jsx(_components.span,{className:`line line-highlight`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` sort_order`})}),`\n`,_jsx(_components.span,{className:`line line-highlight`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` FROM product_categories`})}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` id_col`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` options_col`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` order_by_col`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sort_order\"`})]}),`\n`,_jsx(_components.span,{className:`line line-highlight`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`In addition, the following are some additional examples for creating a `,_jsx(_components.code,{children:`SelectDataSource`}),` object.`]}),`\n`,_jsx(Heading,{level:`3`,id:`using-a-table-from-a-specific-connection`,children:`Using a table from a specific connection`}),`\n`,_jsx(_components.p,{children:`This example uses a table called “departments” from the “hr_db” connection.`}),`\n`,_jsx(CodeBlock,{filename:``,highlight:`[2,5]`,numberOfLines:`6`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`ds.SelectDataSource(`})}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` table_or_query`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"departments\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` id_col`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"dept_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` options_col`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"dept_name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` connection`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"hr_db\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The connection must either be defined in `,_jsx(_components.code,{children:`squirrels.yml`}),` or the `,_jsx(_components.code,{children:`connections.py`}),` file.`]}),`\n`,_jsx(Heading,{level:`3`,id:`using-seeds-as-the-data-source`,children:`Using seeds as the data source`}),`\n`,_jsx(_components.p,{children:`This example uses a seed file called “status_codes”.`}),`\n`,_jsx(CodeBlock,{filename:``,highlight:`[2,5]`,numberOfLines:`6`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`ds.SelectDataSource(`})}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` table_or_query`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"status_codes\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` id_col`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"status_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` options_col`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"status_label\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` source`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`ds.SourceEnum.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`SEEDS`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`setting-default-selected-options`,children:`Setting default selected options`}),`\n`,_jsx(_components.p,{children:`This example marks certain options as selected by default using a column that contains 1 or 0.`}),`\n`,_jsx(CodeBlock,{filename:``,highlight:`[6,11]`,numberOfLines:`12`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`12`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`ds.SelectDataSource(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` table_or_query`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` SELECT `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` region_id,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` region_name,`})}),`\n`,_jsx(_components.span,{className:`line line-highlight`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` (CASE WHEN is_top_choice = 'y' THEN 1 ELSE 0 END) AS is_default`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` FROM regions`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` id_col`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"region_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` options_col`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"region_name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` is_default_col`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"is_default\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`adding-custom-fields-to-options`,children:`Adding custom fields to options`}),`\n`,_jsx(_components.p,{children:`This example creates the following custom fields on each parameter option:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`code`}),` (from column `,_jsx(_components.code,{children:`country_code`}),`)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`population`}),` (from column `,_jsx(_components.code,{children:`population_count`}),`)`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`continent`}),` (from column `,_jsx(_components.code,{children:`continent_name`}),`)`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,highlight:`[5,6,7,8,9]`,numberOfLines:`10`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`ds.SelectDataSource(`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` table_or_query`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"countries\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` id_col`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"country_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` options_col`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"country_name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` custom_cols`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"country_code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"population\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"population_count\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"continent\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"continent_name\"`})]}),`\n`,_jsx(_components.span,{className:`line line-highlight`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`enabling-cascading-effects-with-a-parent-parameter`,children:`Enabling cascading effects with a parent parameter`}),`\n`,_jsx(_components.p,{children:`In this example, the available product options are filtered based on the selected value of another parameter called “product_category”.`}),`\n`,_jsx(CodeBlock,{filename:``,highlight:`[5,20]`,numberOfLines:`21`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`21`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`@p.SingleSelectParameter.create_from_source`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"product\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` label`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Product\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` description`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Select a product from the chosen category\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` parent_name`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"product_category\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`def`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` product_source`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`():`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ds.SelectDataSource(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` table_or_query`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"\"\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` SELECT `})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` product_id,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` product_name,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` category_id,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` price`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` FROM products`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` ORDER BY product_name`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\"\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` id_col`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"product_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` options_col`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"product_name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line line-highlight`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` parent_id_col`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"category_id\"`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # Cascades based on category selection`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"SelectDataSource","tag":"class","description":"Lookup table for select parameter options","href":"/references/python/data_sources/selectdatasource","hidden":false}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Constructor","slug":"constructor","depth":2,"children":[]},{"title":"Examples","slug":"examples","depth":2,"children":[{"title":"Usage example in parameters.py","slug":"usage-example-in-parameters-py","depth":3,"children":[]},{"title":"Using a table from a specific connection","slug":"using-a-table-from-a-specific-connection","depth":3,"children":[]},{"title":"Using seeds as the data source","slug":"using-seeds-as-the-data-source","depth":3,"children":[]},{"title":"Setting default selected options","slug":"setting-default-selected-options","depth":3,"children":[]},{"title":"Adding custom fields to options","slug":"adding-custom-fields-to-options","depth":3,"children":[]},{"title":"Enabling cascading effects with a parent parameter","slug":"enabling-cascading-effects-with-a-parent-parameter","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"squirrels","siteName":"Squirrels Docs","title":"SelectDataSource - Squirrels Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-22T03:43:22.694Z","originalFileLocation":"references/python/data_sources/selectdatasource.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Lookup table for select parameter options\">\u003cmeta data-mint-head name=\"application-name\" content=\"Squirrels Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/squirrels/bgo-igKLFZgRQQUf/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/squirrels/bgo-igKLFZgRQQUf/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/squirrels/bgo-igKLFZgRQQUf/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/squirrels/bgo-igKLFZgRQQUf/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/squirrels/bgo-igKLFZgRQQUf/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/squirrels/bgo-igKLFZgRQQUf/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/squirrels/bgo-igKLFZgRQQUf/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/squirrels/bgo-igKLFZgRQQUf/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/squirrels/bgo-igKLFZgRQQUf/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"SelectDataSource - Squirrels Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Lookup table for select parameter options\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Squirrels Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.pysquirrels.com/references/python/data_sources/selectdatasource\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://squirrels.mintlify.app/_mintlify/api/og/v2?division=data_sources\u0026amp;title=SelectDataSource\u0026amp;description=Lookup+table+for+select+parameter+options\u0026amp;theme=253625986c7ee4cbda5aacec\u0026amp;signature=c68fb99ed2775b7262816ab71b34c125f32f2bf7713b8cefb28b2607f69d13ee\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"SelectDataSource - Squirrels Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Lookup table for select parameter options\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://squirrels.mintlify.app/_mintlify/api/og/v2?division=data_sources\u0026amp;title=SelectDataSource\u0026amp;description=Lookup+table+for+select+parameter+options\u0026amp;theme=253625986c7ee4cbda5aacec\u0026amp;signature=c68fb99ed2775b7262816ab71b34c125f32f2bf7713b8cefb28b2607f69d13ee\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/squirrels/bgo-igKLFZgRQQUf/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Squirrels Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#B85707\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.pysquirrels.com/references/python/data_sources/selectdatasource\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/references/python/data_sources/selectdatasource.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.pysquirrels.com/#organization\",\"name\":\"Squirrels Docs\",\"url\":\"https://docs.pysquirrels.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/squirrels/kzLxoqeVmuUz8Q-T/images/logo/light.svg?fit=max\u0026auto=format\u0026n=kzLxoqeVmuUz8Q-T\u0026q=85\u0026s=d41cdc5597d9b7eebba9bb463f096f13\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.pysquirrels.com#website\",\"name\":\"Squirrels Docs\",\"url\":\"https://docs.pysquirrels.com\",\"publisher\":{\"@id\":\"https://docs.pysquirrels.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.pysquirrels.com/references/python/data_sources/selectdatasource#webpage\",\"url\":\"https://docs.pysquirrels.com/references/python/data_sources/selectdatasource\",\"name\":\"SelectDataSource\",\"description\":\"Lookup table for select parameter options\",\"dateModified\":\"2026-01-22T03:43:22.694Z\",\"isPartOf\":{\"@id\":\"https://docs.pysquirrels.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.pysquirrels.com/references/python/data_sources/selectdatasource#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.pysquirrels.com/references/python/data_sources/selectdatasource#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"data_sources\",\"item\":\"https://docs.pysquirrels.com/references/python/data_sources/sourceenum\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SelectDataSource\",\"item\":\"https://docs.pysquirrels.com/references/python/data_sources/selectdatasource\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.pysquirrels.com/references/python/data_sources/selectdatasource#article\",\"headline\":\"SelectDataSource\",\"name\":\"SelectDataSource\",\"description\":\"Lookup table for select parameter options\",\"url\":\"https://docs.pysquirrels.com/references/python/data_sources/selectdatasource\",\"mainEntityOfPage\":{\"@id\":\"https://docs.pysquirrels.com/references/python/data_sources/selectdatasource#webpage\"},\"dateModified\":\"2026-01-22T03:43:22.694Z\",\"publisher\":{\"@id\":\"https://docs.pysquirrels.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.pysquirrels.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Squirrels Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Squirrels Docs","nav":{"global":null,"tabs":[{"tab":"Home","pages":[{"title":"Home","href":""}]},{"tab":"Documentation","pages":[{"title":"Documentation","href":"/intro"}]},{"tab":"References","anchors":[{"anchor":"Python reference","icon":"python","pages":[{"title":"Overview","href":"/references/python"},{"title":"SquirrelsProject","tag":"class","href":"/references/python/squirrelsproject"},{"group":"arguments","icon":"folder","tag":"module","pages":[{"title":"AuthProviderArgs","tag":"class","href":"/references/python/arguments/authproviderargs"},{"title":"BuildModelArgs","tag":"class","href":"/references/python/arguments/buildmodelargs"},{"title":"ConnectionsArgs","tag":"class","href":"/references/python/arguments/connectionsargs"},{"title":"ContextArgs","tag":"class","href":"/references/python/arguments/contextargs"},{"title":"DashboardArgs","tag":"class","href":"/references/python/arguments/dashboardargs"},{"title":"ModelArgs","tag":"class","href":"/references/python/arguments/modelargs"},{"title":"ParametersArgs","tag":"class","href":"/references/python/arguments/parametersargs"}]},{"group":"auth","icon":"folder","tag":"module","pages":[{"title":"provider","tag":"function","href":"/references/python/auth/provider"},{"title":"CustomUserFields","tag":"class","href":"/references/python/auth/customuserfields"},{"title":"ProviderConfigs","tag":"class","href":"/references/python/auth/providerconfigs"},{"title":"RegisteredUser","tag":"class","href":"/references/python/auth/registereduser"}]},{"group":"connections","icon":"folder","tag":"module","pages":[{"title":"ConnectionProperties","tag":"class","href":"/references/python/connections/connectionproperties"},{"title":"ConnectionTypeEnum","tag":"enum","href":"/references/python/connections/connectiontypeenum"}]},{"group":"parameters","icon":"folder","tag":"module","pages":[{"title":"SingleSelectParameter","tag":"class","href":"/references/python/parameters/singleselectparameter"},{"title":"MultiSelectParameter","tag":"class","href":"/references/python/parameters/multiselectparameter"},{"title":"DateParameter","tag":"class","href":"/references/python/parameters/dateparameter"},{"title":"DateRangeParameter","tag":"class","href":"/references/python/parameters/daterangeparameter"},{"title":"NumberParameter","tag":"class","href":"/references/python/parameters/numberparameter"},{"title":"NumberRangeParameter","tag":"class","href":"/references/python/parameters/numberrangeparameter"},{"title":"TextParameter","tag":"class","href":"/references/python/parameters/textparameter"}]},{"group":"parameter_options","icon":"folder","tag":"module","pages":[{"title":"SelectParameterOption","tag":"class","href":"/references/python/parameter_options/selectparameteroption"},{"title":"DateParameterOption","tag":"class","href":"/references/python/parameter_options/dateparameteroption"},{"title":"DateRangeParameterOption","tag":"class","href":"/references/python/parameter_options/daterangeparameteroption"},{"title":"NumberParameterOption","tag":"class","href":"/references/python/parameter_options/numberparameteroption"},{"title":"NumberRangeParameterOption","tag":"class","href":"/references/python/parameter_options/numberrangeparameteroption"},{"title":"TextParameterOption","tag":"class","href":"/references/python/parameter_options/textparameteroption"}]},{"group":"data_sources","icon":"folder","tag":"module","pages":[{"title":"SourceEnum","tag":"enum","description":"Enum for data source types","href":"/references/python/data_sources/sourceenum"},{"title":"SelectDataSource","tag":"class","href":"/references/python/data_sources/selectdatasource"},{"title":"DateDataSource","tag":"class","description":"Lookup table for date parameter options","href":"/references/python/data_sources/datedatasource"},{"title":"DateRangeDataSource","tag":"class","href":"/references/python/data_sources/daterangedatasource"},{"title":"NumberDataSource","tag":"class","href":"/references/python/data_sources/numberdatasource"},{"title":"NumberRangeDataSource","tag":"class","href":"/references/python/data_sources/numberrangedatasource"},{"title":"TextDataSource","tag":"class","href":"/references/python/data_sources/textdatasource"}]},{"group":"dashboards","icon":"folder","tag":"module","pages":[{"title":"PngDashboard","tag":"class","href":"/references/python/dashboards/pngdashboard"},{"title":"HtmlDashboard","tag":"class","href":"/references/python/dashboards/htmldashboard"}]},{"group":"types","icon":"folder","tag":"module","pages":[{"title":"Dashboard","tag":"abstract","href":"/references/python/types/dashboard"},{"title":"DataSource","tag":"abstract","href":"/references/python/types/datasource"},{"title":"ParameterOption","tag":"abstract","href":"/references/python/types/parameteroption"},{"title":"Parameter","tag":"abstract","href":"/references/python/types/parameter"},{"title":"DatasetMetadata","tag":"class","href":"/references/python/types/datasetmetadata"},{"title":"DatasetResult","tag":"class","href":"/references/python/types/datasetresult"},{"title":"FastAPIComponents","tag":"dataclass","href":"/references/python/types/fastapicomponents"},{"title":"TextValue","tag":"class","href":"/references/python/types/textvalue"}]}]},{"anchor":"CLI reference","icon":"terminal","pages":[{"title":"CLI reference","href":"/references/cli"}]}]},{"tab":"How-to Guides","pages":[{"title":"How-to Guides","href":"/guides/mcp-clients"}]},{"tab":"Release Notes","pages":[{"title":"Release Notes","href":"/releases/v0-6-0"}]}]},"basePath":"","title":"SelectDataSource - Squirrels Docs","buildId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","deploymentId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","dynamics":[],"chunks":[]}