Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
EDsCODE committed Jan 25, 2024
1 parent 17fb483 commit 56c91b9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 18 deletions.
16 changes: 6 additions & 10 deletions frontend/src/scenes/data-warehouse/external/SourceModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { LemonButton, LemonModal, LemonModalProps, Link } from '@posthog/lemon-ui'
import { LemonButton, LemonModal, LemonModalProps } from '@posthog/lemon-ui'
import { useActions, useValues } from 'kea'
import { FEATURE_FLAGS } from 'lib/constants'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
Expand Down Expand Up @@ -79,26 +79,22 @@ function FirstStep(): JSX.Element {

if (config.name === 'Stripe') {
return (
<LemonButton onClick={onClick} className="w-full" center type="secondary">
<LemonButton onClick={onClick} fullWidth center type="secondary">
<img src={stripeLogo} alt="stripe logo" height={50} />
</LemonButton>
)
}
if (config.name === 'Hubspot') {
return (
<div className="w-full">
<Link to={addToHubspotButtonUrl() || ''}>
<LemonButton className="w-full" center type="secondary">
<img src={hubspotLogo} alt="hubspot logo" height={45} />
</LemonButton>
</Link>
</div>
<LemonButton fullWidth center type="secondary" to={addToHubspotButtonUrl() || ''}>
<img src={hubspotLogo} alt="hubspot logo" height={45} />
</LemonButton>
)
}

if (config.name === 'Postgres' && featureFlags[FEATURE_FLAGS.DATA_WAREHOUSE_POSTGRES_IMPORT]) {
return (
<LemonButton onClick={onClick} className="w-full" center type="secondary">
<LemonButton onClick={onClick} fullWidth center type="secondary">
Postgres
</LemonButton>
)
Expand Down
2 changes: 1 addition & 1 deletion posthog/temporal/data_imports/external_data_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ async def run_external_data_job(inputs: ExternalDataJobInputs) -> None:
user=user,
password=password,
database=database,
sslmode="prefer" if settings.TEST else "require",
sslmode="prefer" if settings.TEST or settings.DEBUG else "require",
schema=schema,
table_names=inputs.schemas,
)
Expand Down
4 changes: 2 additions & 2 deletions posthog/warehouse/api/external_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def _handle_postgres_source(self, request: Request, *args: Any, **kwargs: Any) -
schema = payload.get("schema")
table_names = payload.get("schemas")

if self._validate_postgres_host(host, self.team_id):
if not self._validate_postgres_host(host, self.team_id):
raise InternalPostgresError()

new_source_model = ExternalDataSource.objects.create(
Expand Down Expand Up @@ -322,7 +322,7 @@ def reload(self, request: Request, *args: Any, **kwargs: Any):
def database_schema(self, request: Request, *arg: Any, **kwargs: Any):
host = request.query_params.get("host")
port = request.query_params.get("port")
database = request.query_params.get("database")
database = request.query_params.get("dbname")

user = request.query_params.get("user")
password = request.query_params.get("password")
Expand Down
8 changes: 4 additions & 4 deletions posthog/warehouse/api/test/test_external_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def test_internal_postgres(self, patch_get_postgres_schemas):
data={
"host": "172.16.0.0",
"port": int(settings.PG_PORT),
"database": settings.PG_DATABASE,
"dbname": settings.PG_DATABASE,
"user": settings.PG_USER,
"password": settings.PG_PASSWORD,
"schema": "public",
Expand All @@ -187,7 +187,7 @@ def test_internal_postgres(self, patch_get_postgres_schemas):
data={
"host": "172.16.0.0",
"port": int(settings.PG_PORT),
"database": settings.PG_DATABASE,
"dbname": settings.PG_DATABASE,
"user": settings.PG_USER,
"password": settings.PG_PASSWORD,
"schema": "public",
Expand All @@ -203,7 +203,7 @@ def test_internal_postgres(self, patch_get_postgres_schemas):
data={
"host": "172.16.0.0",
"port": int(settings.PG_PORT),
"database": settings.PG_DATABASE,
"dbname": settings.PG_DATABASE,
"user": settings.PG_USER,
"password": settings.PG_PASSWORD,
"schema": "public",
Expand All @@ -219,7 +219,7 @@ def test_internal_postgres(self, patch_get_postgres_schemas):
data={
"host": "172.16.0.0",
"port": int(settings.PG_PORT),
"database": settings.PG_DATABASE,
"dbname": settings.PG_DATABASE,
"user": settings.PG_USER,
"password": settings.PG_PASSWORD,
"schema": "public",
Expand Down
2 changes: 1 addition & 1 deletion posthog/warehouse/models/external_data_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_postgres_schemas(host: str, port: str, database: str, user: str, passwor
dbname=database,
user=user,
password=password,
sslmode="prefer" if settings.TEST else "require",
sslmode="prefer" if settings.TEST or settings.DEBUG else "require",
)

with connection.cursor() as cursor:
Expand Down

0 comments on commit 56c91b9

Please sign in to comment.