Skip to content

Commit

Permalink
Merge commit '2e29f36e7885b693a0af2cf8b0b8ca86d2970f64' into missing_…
Browse files Browse the repository at this point in the history
…i18n
  • Loading branch information
hbruch committed Nov 26, 2021
2 parents 75d0990 + 2e29f36 commit 787009d
Show file tree
Hide file tree
Showing 107 changed files with 12,322 additions and 474 deletions.
20 changes: 20 additions & 0 deletions docs/src/pages/docs/Connecting to Databases/elasticsearch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,23 @@ POST /_aliases
```

Then register your table with the alias name logstasg_all

**Time zone**

By default, Superset uses UTC time zone for elasticsearch query. If you need to specify a time zone,
please edit your Database and enter the settings of your specified time zone in the Other > ENGINE PARAMETERS:


```
{
"connect_args": {
"time_zone": "Asia/Shanghai"
}
}
```

Another issue to note about the time zone problem is that before elasticsearch7.8, if you want to convert a string into a `DATETIME` object,
you need to use the `CAST` function,but this function does not support our `time_zone` setting. So it is recommended to upgrade to the version after elasticsearch7.8.
After elasticsearch7.8, you can use the `DATETIME_PARSE` function to solve this problem.
The DATETIME_PARSE function is to support our `time_zone` setting, and here you need to fill in your elasticsearch version number in the Other > VERSION setting.
the superset will use the `DATETIME_PARSE` function for conversion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ following information about each flight is given:

### Enabling Data Upload Functionality

You may need to enable the functionality to upload a CSV or Excel file to your database. The following section
You may need to enable the functionality to upload a CSV, Excel file or Parquet file to your database. The following section
explains how to enable this functionality for the examples database.

**Note:** To enable `Upload Excel`, you need to make sure that the `xlrd` dependency is installed,
which you can execute `pip install apache-superset[excel]` to install.

In the top menu, select **Data ‣ Databases**. Find the **examples** database in the list and
select the **Edit** button.

Expand Down
1 change: 1 addition & 0 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ werkzeug==1.0.1
# flask-jwt-extended
wtforms==2.3.3
# via
# flask-appbuilder
# flask-wtf
# wtforms-json
wtforms-json==0.3.3
Expand Down
2 changes: 1 addition & 1 deletion requirements/development.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
-r base.in
flask-cors>=2.0.0
mysqlclient==2.0.3
pillow>=8.3.1,<9
pillow>=8.3.2,<9
pydruid>=0.6.1,<0.7
pyhive[hive]>=0.6.1
psycopg2-binary==2.9.1
Expand Down
4 changes: 2 additions & 2 deletions requirements/development.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SHA1:a2fe77c9b8bffc8c8f3de4df6709c8be957c2f87
# SHA1:2d3a7d56d8fdec412b556af9b6dd21a3e6711eb0
#
# This file is autogenerated by pip-compile-multi
# To update, run:
Expand Down Expand Up @@ -40,7 +40,7 @@ mysqlclient==2.0.3
# via -r requirements/development.in
openpyxl==3.0.7
# via tabulator
pillow==8.3.1
pillow==8.4.0
# via -r requirements/development.in
progress==1.6
# via -r requirements/development.in
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def get_git_sha() -> str:
"snowflake-sqlalchemy==1.2.4"
], # PINNED! 1.2.5 introduced breaking changes requiring sqlalchemy>=1.4.0
"teradata": ["sqlalchemy-teradata==0.9.0.dev0"],
"thumbnails": ["Pillow>=7.0.0, <8.0.0"],
"thumbnails": ["Pillow>=8.3.2, <9.0.0"],
"vertica": ["sqlalchemy-vertica-python>=0.5.9, < 0.6"],
"netezza": ["nzalchemy>=11.0.2"],
},
Expand Down
50 changes: 25 additions & 25 deletions superset-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions superset-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
"@types/enzyme-adapter-react-16": "^1.0.6",
"@types/fetch-mock": "^7.3.2",
"@types/jest": "^26.0.3",
"@types/jquery": "^3.3.32",
"@types/jquery": "^3.5.8",
"@types/js-levenshtein": "^1.1.0",
"@types/json-bigint": "^1.0.0",
"@types/react": "^16.9.43",
Expand Down Expand Up @@ -278,7 +278,7 @@
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^7.1.0",
"eslint-import-resolver-typescript": "^2.5.0",
"eslint-import-resolver-webpack": "^0.13.1",
"eslint-import-resolver-webpack": "^0.13.2",
"eslint-plugin-cypress": "^2.11.2",
"eslint-plugin-file-progress": "^1.2.0",
"eslint-plugin-import": "^2.24.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { Provider } from 'react-redux';
import { mockStore } from 'spec/fixtures/mockStore';
import { styledMount as mount } from 'spec/helpers/theming';
import waitForComponentToPaint from 'spec/helpers/waitForComponentToPaint';
import { Dropdown, Menu } from 'src/common/components';
import Alert from 'src/components/Alert';
import { FiltersConfigModal } from 'src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal';

Expand Down Expand Up @@ -60,7 +61,7 @@ jest.mock('@superset-ui/core', () => ({
describe('FiltersConfigModal', () => {
const mockedProps = {
isOpen: true,
initialFilterId: 'DefaultsID',
initialFilterId: 'NATIVE_FILTER-1',
createNewOnOpen: true,
onCancel: jest.fn(),
onSave: jest.fn(),
Expand Down Expand Up @@ -112,9 +113,13 @@ describe('FiltersConfigModal', () => {
await waitForComponentToPaint(wrapper);
}

function addFilter() {
async function addFilter() {
act(() => {
wrapper.find('[aria-label="Add filter"]').at(0).simulate('click');
wrapper.find(Dropdown).at(0).simulate('mouseEnter');
});
await waitForComponentToPaint(wrapper, 300);
act(() => {
wrapper.find(Menu.Item).at(0).simulate('click');
});
}

Expand All @@ -124,7 +129,7 @@ describe('FiltersConfigModal', () => {
});

it('shows correct alert message for unsaved filters', async () => {
addFilter();
await addFilter();
await clickCancel();
expect(onCancel.mock.calls).toHaveLength(0);
expect(wrapper.find(Alert).text()).toContain(
Expand Down
2 changes: 2 additions & 0 deletions superset-frontend/src/components/ListView/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,6 @@ export enum FilterOperator {
between = 'between',
dashboardIsFav = 'dashboard_is_favorite',
chartIsFav = 'chart_is_favorite',
chartIsCertified = 'chart_is_certified',
dashboardIsCertified = 'dashboard_is_certified',
}
17 changes: 16 additions & 1 deletion superset-frontend/src/components/ListViewCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { styled, useTheme } from '@superset-ui/core';
import { AntdCard, Skeleton, ThinSkeleton } from 'src/common/components';
import { Tooltip } from 'src/components/Tooltip';
import ImageLoader, { BackgroundPosition } from './ImageLoader';
import CertifiedIcon from '../CertifiedIcon';

const ActionsWrapper = styled.div`
width: 64px;
Expand Down Expand Up @@ -161,6 +162,8 @@ interface CardProps {
rows?: number | string;
avatar?: React.ReactElement | null;
cover?: React.ReactNode | null;
certifiedBy?: string;
certificationDetails?: string;
}

function ListViewCard({
Expand All @@ -178,6 +181,8 @@ function ListViewCard({
loading,
imgPosition = 'top',
cover,
certifiedBy,
certificationDetails,
}: CardProps) {
const Link = url && linkComponent ? linkComponent : AnchorLink;
const theme = useTheme();
Expand Down Expand Up @@ -249,7 +254,17 @@ function ListViewCard({
<TitleContainer>
<Tooltip title={title}>
<TitleLink>
<Link to={url!}>{title}</Link>
<Link to={url!}>
{certifiedBy && (
<>
<CertifiedIcon
certifiedBy={certifiedBy}
details={certificationDetails}
/>{' '}
</>
)}
{title}
</Link>
</TitleLink>
</Tooltip>
{titleRight && <TitleRight>{titleRight}</TitleRight>}
Expand Down
17 changes: 12 additions & 5 deletions superset-frontend/src/components/TableCollection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ export const Table = styled.table`
}
}
.empty-loading-bar {
display: inline-block;
width: 100%;
height: 1.2em;
}
&:after {
position: absolute;
transform: translateY(-50%);
Expand Down Expand Up @@ -257,7 +263,7 @@ export default React.memo(
<tbody {...getTableBodyProps()}>
{loading &&
rows.length === 0 &&
[...new Array(25)].map((_, i) => (
[...new Array(12)].map((_, i) => (
<tr key={i}>
{columns.map((column, i2) => {
if (column.hidden) return null;
Expand All @@ -266,12 +272,13 @@ export default React.memo(
key={i2}
className={cx('table-cell', {
'table-cell-loader': loading,
[column.size || '']: column.size,
})}
>
<span className="loading-bar" role="progressbar">
<span>LOADING</span>
</span>
<span
className="loading-bar empty-loading-bar"
role="progressbar"
aria-label="loading"
/>
</td>
);
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { getChartIdsInFilterScope } from '../../util/activeDashboardFilters';
import findTabIndexByComponentId from '../../util/findTabIndexByComponentId';
import { findTabsWithChartsInScope } from '../nativeFilters/utils';
import { setInScopeStatusOfFilters } from '../../actions/nativeFilters';
import { NATIVE_FILTER_DIVIDER_PREFIX } from '../nativeFilters/FiltersConfigModal/utils';

type DashboardContainerProps = {
topLevelTabs?: LayoutItem;
Expand Down Expand Up @@ -71,6 +72,7 @@ const DashboardContainer: FC<DashboardContainerProps> = ({ topLevelTabs }) => {
const filterScopes = Object.values(nativeFilters ?? {}).map(filter => ({
id: filter.id,
scope: filter.scope,
type: filter.type,
}));
useEffect(() => {
if (
Expand All @@ -80,6 +82,13 @@ const DashboardContainer: FC<DashboardContainerProps> = ({ topLevelTabs }) => {
return;
}
const scopes = filterScopes.map(filterScope => {
if (filterScope.id.startsWith(NATIVE_FILTER_DIVIDER_PREFIX)) {
return {
filterId: filterScope.id,
tabsInScope: [],
chartsInScope: [],
};
}
const { scope } = filterScope;
const chartsInScope: number[] = getChartIdsInFilterScope({
filterScope: {
Expand Down
Loading

0 comments on commit 787009d

Please sign in to comment.