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

Can't see and add tags #32150

Closed
3 tasks done
Maksim252-c opened this issue Feb 5, 2025 · 6 comments
Closed
3 tasks done

Can't see and add tags #32150

Maksim252-c opened this issue Feb 5, 2025 · 6 comments

Comments

@Maksim252-c
Copy link

Bug description

I can't find the reason why the tags are not visible. There are no sections with tags, it is impossible to add tags.
I added TAGGING_SYSTEM=True and ENABLE_TAGS = True to the configuration file, but the tags are still not visible.
In addition, it is worth mentioning that folders with tags are present in the project directory.

Screenshots/recordings

Image
Image
Image
Image
Image
Image

Superset version

4.1.1

Python version

3.10

Node version

18 or greater

Browser

Chrome

Additional context

I also note that the project is deployed via WSL.

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Copy link

dosubot bot commented Feb 5, 2025

Hey @Maksim252-c! I'm here to help you with any bugs, questions, or contributions you have. Just let me know how I can assist you!

The issue you're experiencing with the tags not being visible in Superset, despite setting TAGGING_SYSTEM=True and ENABLE_TAGS=True, might be related to feature flags in the codebase. Specifically, the tags feature visibility is controlled by the TaggingSystem feature flag. Even if the configuration settings are enabled, the tags will not be displayed if the TaggingSystem feature flag is not enabled in the code.

Here's a relevant code snippet that shows this conditional logic:

{
  Cell: ({
    row: {
      original: { tags = [] },
    },
  }: any) => (
    // Only show custom type tags
    <TagsList tags={tags.filter((tag: Tag) => tag.type === 1)} />
  ),
  Header: t('Tags'),
  accessor: 'tags',
  disableSortBy: true,
  hidden: !isFeatureEnabled(FeatureFlag.TaggingSystem),
},

The hidden property is set based on the result of isFeatureEnabled(FeatureFlag.TaggingSystem). If this feature flag is not enabled, the tags column will be hidden, regardless of the TAGGING_SYSTEM and ENABLE_TAGS settings [1].

To resolve this, ensure that the TaggingSystem feature flag is enabled in your Superset configuration. You might need to check the feature flag settings in your deployment to confirm this.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@Maksim252-c
Copy link
Author

@dosu
I added FEATURE_FLAGS = { "TaggingSystem": True } to the superset_config.py file, and upgraded the code using pip install --upgrade apache-superset, but the tags are still not visible.

Copy link

dosubot bot commented Feb 5, 2025

Ensure that the feature flags are correctly initialized in your Superset setup. The feature flags are typically initialized in the superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts file using the initFeatureFlags() function. This function should be called with the correct feature flag settings, including "TaggingSystem": True [1].

Additionally, verify that the frontend components responsible for displaying tags are not encountering any issues. The file superset-frontend/src/pages/Tags/index.tsx handles the display of tags, and it relies on the isFeatureEnabled(FeatureFlag.TaggingSystem) function to determine visibility. Make sure there are no errors in the console that might indicate issues with this component [2].

If the problem persists, check the network requests in your browser's developer tools to ensure that the API endpoints for fetching tags are being called correctly and returning the expected data.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@Maksim252-c
Copy link
Author

@dosu
How should I prescribe it?
In the current version, initFeatureFlags() function in the featureFlags.ts file looks like this:

export function initFeatureFlags(featureFlags?: FeatureFlagMap) {
if (!window.featureFlags) {
window.featureFlags = featureFlags || {};
}
}

And index.tsx in the /src/pages/Tags looks like this:

import { isFeatureEnabled, FeatureFlag, t } from '@superset-ui/core';
....................
<ListView
bulkActions={bulkActions}
bulkSelectEnabled={bulkSelectEnabled}
cardSortSelectOptions={sortTypes}
className="tags-list-view"
columns={columns}
count={tagCount}
data={tags}
disableBulkSelect={toggleBulkSelect}
refreshData={refreshData}
emptyState={emptyState}
fetchData={fetchData}
filters={filters}
initialSort={initialSort}
loading={loading}
addDangerToast={addDangerToast}
addSuccessToast={addSuccessToast}
pageSize={PAGE_SIZE}
showThumbnails={
userKey
? userKey.thumbnails
: isFeatureEnabled(FeatureFlag.Thumbnails)
}
defaultViewMode={
isFeatureEnabled(FeatureFlag.ListviewsDefaultCardView)
? 'card'
: 'table'
}
/>

Copy link

dosubot bot commented Feb 6, 2025

To ensure that the TaggingSystem feature flag is correctly initialized and used in your Superset setup, follow these steps:

  1. Verify Backend Configuration: Ensure that your superset_config.py file includes the correct feature flag configuration:

    FEATURE_FLAGS = {
        "TaggingSystem": True,
        # Add other feature flags as needed
    }
  2. Frontend Initialization: The initFeatureFlags() function in featureFlags.ts should be called with the feature flags from the backend. This typically happens during the application bootstrap process. Ensure that the bootstrapData.common.feature_flags object is correctly populated and passed to initFeatureFlags().

  3. Check Frontend Code: In your index.tsx file for the Tags page, ensure that the isFeatureEnabled(FeatureFlag.TaggingSystem) is used to control the visibility of tags. If the feature flag is not enabled, the tags will not be displayed.

  4. Debugging: Use the browser's developer tools to check if the window.featureFlags object contains the TaggingSystem flag set to true. You can do this by running console.log(window.featureFlags) in the browser console.

  5. Network Requests: Verify that the API requests related to tags are being made and returning the expected data. Check the network tab in the developer tools for any failed requests or errors.

By ensuring that the feature flags are correctly set up and initialized, you should be able to resolve the issue with the tags not being visible.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@Maksim252-c
Copy link
Author

A solution has been found. The problem with tag visibility was that in the configuration file TAGGING_SYSTEM it was written in lowcase letters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant